I'm using a simple servlet filter that forces the browser to skip caching for some server resources:
Cache-Control: private Pragma:
This works fine in Internet Explorer but it doesn't works well with Firefox 3.0.10. I ended to write this code:
Cache-Control: no-cache, no-store, must-revalidate, max-age=-1 Pragma: no-cache, no-store Expires: -1 // -1 is the unix time, the client receives a date in 1969 :) Last-Modified: -1 // ditto
this forces firefox to cache nothing. What about other browsers? What about best practices on no caching headers that works on major browsers?
Drupal 6 does this (which works in every browser known by me):
No pragma header in this instance. I'm not sure why your example doesn't work, it might be the negative timestamps, this works on ~250.000 Drupal sites :)
Your initial solution did not work reliably because:
Pragma:
header does not include a value. I'm not sure it's even legal - in terms of the HTTP protocol.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With