1

For preventing the browser cache I followed this How to control web page caching, across all browsers?.

  response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
  response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
  response.setDateHeader("Expires", 0);

This is working fine with Google Chrome, but the problem is with Firefox. After adding above mentioned headers firefox is still caching my content.

  1. Is there any way to stop Firefox from caching my content?

  2. All the cached content is stored in plain text only. How can I force the browser to encrypt the content before caching it?

I observed that some other sites' cache is not stored as plain text. Even the JavaScript (js) file is in encrypted format (in cache).

Below image show the headers received in the response.

Headers received in response. After adding those headers to jsp

Community
  • 1
  • 1

1 Answers1

1

Firefox should be not caching with those response headers. Can you post a screen shot of the actual response headers as seen by Firefox? (CTRL-SHIFT-C, Network tab). You probably want response.setHeader("Expires", 0); instead though.

You don't need to encrypt the cache on the client if the cache is empty. Also, you can't anyway.

You're using HTTPS right?

Neil McGuigan
  • 41,314
  • 10
  • 106
  • 137