0

I am trying to determine when newly set cache-control headers will be read by end-users who have previously cached a page.

Let's say a user loads a page that does not have any cache-control headers set. Then I add cache-control: no-cache, no-store header at the server level. Will it force even the users who had previously visited and cached the page to get the latest version? Or would their current version have to expire per their browsers rules since no headers were initially set?

Justin
  • 26,443
  • 16
  • 111
  • 128

1 Answers1

1

The latter. Headers aren't pushed unless a user agent requests a resource. However, see this question. If a client makes a conditional request to validate its cache, those headers will also be sent in 304 responses. The spec says the cache MUST

use other header fields provided in the 304 (Not Modified) response to replace all instances of the corresponding header fields in the stored response.

Community
  • 1
  • 1
Joe
  • 29,416
  • 12
  • 68
  • 88