Skip to content

Commit c59df45

Browse files
rjgtavRicardo Tavares
andauthored
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>
1 parent 066997d commit c59df45

File tree

1 file changed

+2
-0
lines changed
  • templates/with-cloudflare-d1/public

1 file changed

+2
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/_next/static/*
2+
Cache-Control: public,max-age=31536000,immutable

0 commit comments

Comments
 (0)