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 – eyoung100 Aug 29 '14 at 13:38
  • A search for 'cachebuster' should help somewhat - see also stackoverflow.com/questions/7281127/… – joesk Aug 29 '14 at 15:47
  • What web server are you using? – closetnoc Aug 29 '14 at 23:15
  • @closetnoc I use servers Apache2 and Jetty. – Colargol Sep 1 '14 at 7:27

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. – dartonw Aug 30 '14 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.