A Jackson
A Jackson

Reputation: 2856

IE11 returning 304 for No-Cache request

I'm working on a web app that gets data from an API. The API includes cache headers on most resources and generally this works as expected. However, when the app modifies a resource via POST, PUT, DELETE the cache of the GET for the same URI must be invalidated. This is described in RFC 7234 4.4

In our testing it seems that IE 11 does not respect that and is returning cached resources with a 304 Not Modified response. To get around this, on the next GET request following a state change request, I have tried adding the request header Cache-Control: No-Cache, No-Store

I'm still getting a 304 Not Modified cached response.

How can I get IE 11 to ignore it's cache and go to the server again? This all works as expected in Chrome.

It's it's relevant I'm using fetch

Upvotes: 2

Views: 2167

Answers (1)

Alex Slipknot
Alex Slipknot

Reputation: 2533

As I mentioned in the comment, you have to try these headers:

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

Upvotes: 3

Related Questions