Ajax cache problems in the lower version of IE browser

problem:

In the low version of the IE browser, Ajax request caching serious problem that in the case of a request address does not change, only the first request is actually sent to the server, subsequent requests will be from the browser's cache get results. Even if the data server-side updates, the client still got the cache of old data.

solution:

After the request address plus parameter request, to ensure that every request parameter values ​​in the request is not the same.

 xhr.open('get', 'http://www.example.com?t=' + Math.random());
Published 316 original articles · won praise 270 · views 40000 +

Guess you like

Origin blog.csdn.net/qq_44721831/article/details/104410387