remix
remix copied to clipboard
Remix doesn't use browser cached versions of route JS/manifest
What version of Remix are you using?
1.7.2
Steps to Reproduce
Production version deployed of any application with correctly configured CDN permanently caching assets.
Chrome version 105.0.5195.125 if relevant.
Expected Behavior
Requests to any assets that have been previously retrieved by the browser should hit the browser cache first.
Actual Behavior
Assets retrieved in the root of the application hit the browser cache first but other routes will always be requested from the CDN.
If you look at the below screenshot you'll see that all the top-level assets are returned from memory/disk cache but the $interactionld-6GDCZIFD.js
and manifest-888341CD.js
files hit the CDN and get a 304
even though these are available locally (hence the 304).
![Network Requests Waterfall Example](https://user-images.githubusercontent.com/112806/195218062-5e079c6c-5368-4257-bfe2-29be316433d9.png)
@waynerobinson What are the other response headers on those two files? (Especially cache-control
) I assume this is using the built in remix server? (We have no issues with this when using Express with custom caching behaviour)
app.use("/build", express.static("public/build", { immutable: true, maxAge: "1y" }));