I am facing issues in my React application on IE11
where the UI is not hitting backend services for every new request and returning the response from cache data. The application works fine on Chrome.
In case of IE the services end with code : 304 instead of 200. PFB the request headers:
Accept application/json,*/*
Request GET /services/v0/search/?uid=12900 HTTP/1.1
Content-Type application/json
Cache-Control no-cache
PFB the response headers obtained on IE
:
Response HTTP/1.1 304 Not Modified
x-frame-options DENY
x-xss-protection 1; mode=block
x-content-type-options nosniff
Any clue, what could be the reason behind IE rendering such behaviour? TIA
I just came across the same issue where the IE11 simply ignores the get request to the backend server. The quick way I found to fix is to pass one unnecessary param with the get request, in our case, a timestamp.
const t = Date.now();
axios.get(`${API_DOMAIN}/api/bookingep/find?c=${t}`);
Because every time the timestamp is different, the ie11 does send out the get request as expected.
You could try adding the "Pragma" header:
headers: { Pragma: 'no-cache'}
also mentioned here : Axios only called once inside self-invoking function (Internet Explorer)
From docs
Check this header in your http request :
Cache-Control:
no-cache
:
Forces caches to submit the request to the origin server for validation before releasing a cached copy
no-store
:
The cache should not store anything about the client request or server response.
must-revalidate
(Revalidation and reloading
) :
The cache must verify the status of the stale resources before using it and expired ones should not be used
Expires
:
0 -the resource is already expired
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