Is it possible to force browser to not using cache and download all files (html/js/css) every time? I am looking for a server side solution.
-
Turning off, or forcing an empty cache is only available on the Client's browser settings. The only tools I know of server side enable faster caching for serving pages– eyoung100Aug 29, 2014 at 13:38
-
A search for 'cachebuster' should help somewhat - see also stackoverflow.com/questions/7281127/…– joeskAug 29, 2014 at 15:47
-
What web server are you using?– closetnocAug 29, 2014 at 23:15
-
@closetnoc I use servers Apache2 and Jetty.– ColargolSep 1, 2014 at 7:27
1 Answer
You can do this on the web server by sending the correct HTTP headers for those content types. See the W3C HTTP cache control rules. The most important header for your scenario is:
Cache-Control: no-cache
This directive alone should be enough to ensure no proxy or user agent will cache the content.
For Apache, use mod_headers to send cache directives based on the content type requested.
-
Yeah, not sure what I was thinking. That's what I get for insomniac posting.– dartonwAug 30, 2014 at 14:42