How to get IE to not cache GET requests?
After testing our REST services it was found that in IE 11 the requests were being cached. We were not seeing this issue in Chrome.
So the easiest solution was to do the following.
- Go to Internet options in IE
- On General tab click Settings button (in browsing history)
- For ‘Check for newer version of stored pages check : ‘Every time I visit the web page’.
- Save changes.
Now I cannot expect our customers to do the same. So how do you do make the requests not cache and each call?
Headers to the Rescue
After playing around with different settings the following worked:
cache-control:n0-cache, pragma:no-cache, expires: -1
More information about these headers can be found here.