Hi
I have hosted the website called www.tituswedsroshin.com [NextJS] in Netlify
Unfortunately its serving previous build’s stale content or build files.
Here are the request id for the stale site.
x-nf-request-id: 01G108T6FZ4DG9N2E28PDS29DC
x-nf-request-id: 01G1090AYAC3BGJQ17XEM63X60
Now when i add a query parameter
“Titus and Roshin's Wedding Website”
It serves the correct content
( Request id for the same )
x-nf-request-id: 01G109355396V8Q35J6XCCMQC9
What shall i do from my end , to so that after each build , rightful pages & build files are served correctly without hampering the users ??
Is it an issue from my end or from your end ?
Hoping to hear from you at the earliest
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
RE : Email Update as suggested by @luke
Luke Lawson (Netlify)
Apr 19, 2022, 1:57 AM EDT
Hi Titus,
You are overriding our fine-grained cache invalidation by modifying the cache-control
headers. You can see the cache control header being sent below:
$ curl --compressed -svo /dev/null https://www.tituswedsroshin.com/ 2>&1 | egrep -i 'cache-control'< cache-control: public,max-age=31560000,immutable
That header above tells our CDN to cache the URL for a year.
If you do not want our CDN to cache the content for longer than the time the deploy is active, you must use our default cache-control
. When you change the default headers you change the behavior of our CDN for your site.
There is a blog post about how we cache at Netlify written by one of our founders here:
If you use the cache-control: public, max-age=0, must-revalidate
header, then the content will be correctly purged when new deploys occur.