Next.js Discord

Discord Forum

Navigation returns 304 to the browser after some time

Unanswered
Masked Duck posted this in #help-forum
Open in Discord
Masked DuckOP
In production, node, standalone mode, some of my pages send back an empty 304 to the browser instead of a 200 with some content as would be expected (no If-modified-since header sent).

Even a simple curl directly on the prod machine with no proxy intermediate would return a 304 on my /help page for example:

# curl -vvv http://localhost:3000/help

> GET /help HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.81.0
> Accept: */*

< HTTP/1.1 304 Not Modified
< Vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url, Accept-Encoding
< x-nextjs-cache: HIT
< X-Powered-By: Next.js
< Cache-Control: s-maxage=3600, stale-while-revalidate
< ETag: "8rwdva8sz0azu"
< Content-Type: text/html; charset=utf-8
< Content-Length: 14285
< Date: Wed, 20 Sep 2023 15:42:35 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5


I suspect "some time" is actually one hour after the last successful browse of the page as my fetch revalidate option is set to 3600. (Note: except for a single fetch for metadata, my /help page is very basic).

This is occurring with 13.5.1 and was not happening with 13.4.12

This completely broke my production server. Destroying the container and restarting it fixes the issue temporarily

0 Replies