Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Set Cache-Control: no-cache on responses #586
Cache-Control: no-cache tells the browser that it may cache the response, but it must always revalidate the cached response with the server, before using it. This is equivalent to setting
See also https://stackoverflow.com/a/19938619/826486 for more discussion on
changed the title from
Set Cache-Control: no-cache on responses Cache-Control: no-cache tells the browser that it may cache the response, but it must always revalidate the cached response with the server, before using it. This is equivalent to setting
Set Cache-Control: no-cache on responses
Jul 24, 2017
@danielcompton I think this is the right thing to do. Note that as I understand it setting
Does figwheel honor the
Figwheel doesn't send an Etag for files so it won't get an If-None-Match (though that might be a good future improvement). AFAICT it didn't return a 304 for If-Modified-Since, I think static files are served from https://github.com/danielcompton/lein-figwheel/blob/1c5fb829b59230bf03bc1f565be103543ecd41c0/sidecar/src/figwheel_sidecar/components/figwheel_server.clj#L163-L174.
I've just added another commit which checks the If-Modified-Since header. I checked this now, and verified that before the wrap-not-modified addition, Chrome requested the files every reload, and got a 200 every time. After adding wrap-not-modified, we get pleasing 304's for everything after initial load.