Fork of Chiri for Astro for my blog
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: optimize cache strategy

the3ash 22f52a05 f1caa7d0

+42 -43
+42 -43
netlify.toml
··· 20 20 [build.processing.html] 21 21 pretty_urls = true 22 22 23 - # Static assets caching 23 + # Global headers 24 24 [[headers]] 25 - for = "/fonts/*" 25 + for = "/*" 26 26 [headers.values] 27 - Cache-Control = "public, max-age=31536000, immutable" 28 - Vary = "Accept-Encoding" 27 + X-Frame-Options = "SAMEORIGIN" 28 + X-Content-Type-Options = "nosniff" 29 + Referrer-Policy = "strict-origin-when-cross-origin" 30 + Permissions-Policy = "geolocation=(), microphone=(), camera=(), fullscreen=(self)" 31 + Content-Security-Policy = ''' 32 + default-src 'self'; 33 + script-src 'self' 'unsafe-inline' 'unsafe-eval' https:; 34 + style-src 'self' 'unsafe-inline' https:; 35 + img-src 'self' data: https: blob:; 36 + font-src 'self' data: https:; 37 + frame-src https:; 38 + connect-src 'self' https:; 39 + object-src 'none'; 40 + worker-src 'self' blob:; 41 + child-src 'self' blob:; 42 + ''' 29 43 44 + # HTML pages 30 45 [[headers]] 31 - for = "/_astro/*" 46 + for = "/*.html" 32 47 [headers.values] 33 - Cache-Control = "public, max-age=31536000, immutable" 48 + Cache-Control = "public, max-age=3600, s-maxage=7200" 34 49 Vary = "Accept-Encoding" 35 50 51 + # Blog posts 36 52 [[headers]] 37 - for = "/*.css" 53 + for = "/*/" 38 54 [headers.values] 39 - Cache-Control = "public, max-age=31536000, immutable" 55 + Cache-Control = "public, max-age=7200, s-maxage=14400" 40 56 Vary = "Accept-Encoding" 41 57 58 + # Homepage 42 59 [[headers]] 43 - for = "/*.js" 60 + for = "/" 44 61 [headers.values] 45 - Cache-Control = "public, max-age=31536000, immutable" 62 + Cache-Control = "public, max-age=1800, s-maxage=3600" 46 63 Vary = "Accept-Encoding" 47 64 65 + # Static assets 48 66 [[headers]] 49 - for = "/assets/*" 67 + for = "/fonts/*" 50 68 [headers.values] 51 69 Cache-Control = "public, max-age=31536000, immutable" 52 70 Vary = "Accept-Encoding" 53 71 54 - # Image optimization 55 72 [[headers]] 56 - for = "/*.jpg" 73 + for = "/_astro/*" 57 74 [headers.values] 58 75 Cache-Control = "public, max-age=31536000, immutable" 59 76 Vary = "Accept-Encoding" 60 77 61 78 [[headers]] 62 - for = "/*.png" 79 + for = "/assets/*" 63 80 [headers.values] 64 81 Cache-Control = "public, max-age=31536000, immutable" 65 82 Vary = "Accept-Encoding" 66 83 67 84 [[headers]] 68 - for = "/*.webp" 85 + for = "/*.css" 69 86 [headers.values] 70 87 Cache-Control = "public, max-age=31536000, immutable" 71 88 Vary = "Accept-Encoding" 72 89 73 - # HTML caching for static pages 74 90 [[headers]] 75 - for = "/*.html" 91 + for = "/*.js" 76 92 [headers.values] 77 - Cache-Control = "public, max-age=3600, s-maxage=7200" 93 + Cache-Control = "public, max-age=31536000, immutable" 78 94 Vary = "Accept-Encoding" 79 95 80 - # Homepage with resource hints and shorter cache 96 + # Images 81 97 [[headers]] 82 - for = "/" 98 + for = "/*.jpg" 83 99 [headers.values] 84 - Link = "</fonts/Inter.woff2>; rel=preload; as=font; type=font/woff2; crossorigin=anonymous, </fonts/Besley-Italic.woff2>; rel=preload; as=font; type=font/woff2; crossorigin=anonymous" 85 - Cache-Control = "public, max-age=1800, s-maxage=3600" 100 + Cache-Control = "public, max-age=31536000, immutable" 86 101 Vary = "Accept-Encoding" 87 102 88 - # Blog post pages (direct slug routes) 89 103 [[headers]] 90 - for = "/*/" 104 + for = "/*.png" 91 105 [headers.values] 92 - Cache-Control = "public, max-age=7200, s-maxage=14400" 106 + Cache-Control = "public, max-age=31536000, immutable" 93 107 Vary = "Accept-Encoding" 94 108 95 - # Global headers for performance 96 109 [[headers]] 97 - for = "/*" 110 + for = "/*.webp" 98 111 [headers.values] 99 - X-Frame-Options = "SAMEORIGIN" 100 - X-Content-Type-Options = "nosniff" 101 - Referrer-Policy = "strict-origin-when-cross-origin" 102 - Permissions-Policy = "geolocation=(), microphone=(), camera=(), fullscreen=(self)" 103 - Content-Security-Policy = ''' 104 - default-src 'self'; 105 - script-src 'self' 'unsafe-inline' 'unsafe-eval' https:; 106 - style-src 'self' 'unsafe-inline' https:; 107 - img-src 'self' data: https: blob:; 108 - font-src 'self' data: https:; 109 - frame-src https:; 110 - connect-src 'self' https:; 111 - object-src 'none'; 112 - worker-src 'self' blob:; 113 - child-src 'self' blob:; 114 - ''' 112 + Cache-Control = "public, max-age=31536000, immutable" 113 + Vary = "Accept-Encoding" 115 114 116 115 117 116