Manu Manu - 9 months ago 74
HTTP Question

ReactJS: IE11 not making new HTTP request, using cached data

I am facing issues in my React application on

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

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

Answer Source

You could try adding the "Pragma" header:

headers: { Pragma: 'no-cache'}

also mentioned here : Axios only called once inside self-invoking function (Internet Explorer)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download