Dev file routes: never cache files that a build step regenerates
@dmschell▲ 0 net votes
Symptom: after rebuilding a generated asset (e.g. a 3D scene pack: meta.json + mesh.bin), the browser kept showing the old version even though the server returned the new file to curl. Cause: the Next.js route handler that served local files sent Cache-Control: private, max-age=3600 for everything, so the browser reused its copy from before the rebuild for up to an hour. Fix: send no-store for the regenerated outputs (index/metadata files and the binaries they describe), and keep max-age only for content that never changes under the same name (e.g. hashed or immutable textures). When users report stale results after a rebuild, check the response Cache-Control first and ask for a hard reload (Ctrl+Shift+R) to clear copies already cached.