perf(templates): added cloudflare cache headers for static files (#14069)
### What? Adds Cache-Control headers for the static files generated by Next.js (e.g. .js files). This follows a recommendation by the OpenNext team: https://opennext.js.org/cloudflare/caching#static-assets-caching ### Why? To avoid avoiding unnecessary revalidation requests caused by Workers Static Assets' default headers. ### How? By caching the static files for up to an year. Co-authored-by: Ricardo Tavares <rtavares@cloudflare.com>
This commit is contained in:
2
templates/with-cloudflare-d1/public/_headers
Normal file
2
templates/with-cloudflare-d1/public/_headers
Normal file
@@ -0,0 +1,2 @@
|
||||
/_next/static/*
|
||||
Cache-Control: public,max-age=31536000,immutable
|
||||
Reference in New Issue
Block a user