Home
Support Forums

Issues with nextjs plugin sending stale-while-revalidate, even after corrected plugin

We had some issues with the beta plugin for netlify, and it was serving with stale-while-revalidate set. Now that we updated the plugin to a fixed version that doesn’t do this, I’m still getting the old content. Is there a way to purge the CDN so it can re-examine the correct headers to set? Main site is here and here is the url that’s not behind our own domain.

Example request that responds with SWR.

x-nf-request-id: 01FJYKJTJ5P7VJT8VQCVH1QBR4

HTTP/2 200 OK
cache-control: s-maxage=31536000, stale-while-revalidate
content-type: text/html; charset=utf-8
date: Sun, 24 Oct 2021 15:24:30 GMT
etag: "177fe5-Jj4u300IjU6oDJ2/roIim1VZtgU-df"
vary: Accept-Encoding
server: Netlify
x-nf-request-id: 01FJYKJTJ5P7VJT8VQCVH1QBR4
x-powered-by: Next.js
content-encoding: gzip
content-length: 319534
age: 173159
X-Firefox-Spdy: h2

This seems quite suboptimal. Are you setting this value directly? it tells us to cache these things for a year (so you’ll see stale content), but also, we don’t support stale-while-revalidate so you shouldn’t be setting it if you can control that.

I’ve attempted to purge your cache (which you could also do with a redeploy and/or rolling back and forward again), but since you’ve told our proxy to save this for a year and that can require help from our networking team to drop that cache.

I’d suggest fixing your cache settings before we attempt to repair further, in case my fix (and your deploys) didn’t fix the cache, since otherwise, the problem will recur, likely in ways you still cannot fix yourself.

I linked to the discussion we’re having over the netlify plugin. The beta version for a while was not removing those, when someone had configured their site for ISR (which netlify doesn’t actually support, but the way it fell back was OK, prior to this brief time in the beta plugin). So, I suspect anyone who’s been running the beta plugin recently with ISR configured will have this same issue. It’s been fixed in the latest version I’m running, and without this cache purged, I’m going on day 5 of a broken website and no way to take payments from users.

Just checked, CDN is still serving this old page for anything that was accessed during this window (ie. /)

I would like to jump onto this issue. I also used the broken beta and moved to the new one that has this fixed. We already tried to create a new site and migrate everything over, but it looks like the cache depends on the hostname used for the request.

Here is a request that gets the stale content: x-nf-request-id: 01FJYRXJZ33T8CZM3BNT2ZRW8H

@fool can you provide some urgent guidance about what to do? We’re literally twiddling our thumbs with a broken site wondering what to do here. Email support? Something else?

Hi, @embarrassment-setup and @Fox32. Both sites have had the cached content purged and both are showing the default cache-control header (cache-control: public, max-age=0, must-revalidate) and current deploy now.

If you see any further issues or if there are any questions, please let us know.

Thanks, looks good so far.

Sure was nice to wake up to this today! Looks good here too. Thanks everyone.