How to disable Ajax caching?

后端 未结 3 1817
夕颜
夕颜 2020-12-06 06:43

I am having an issue with ajax caching, This was a problem in IE browser too but i fixed it by Writing the Following code.

    response.setHeader(\"Cache-Co         


        
3条回答
  •  半阙折子戏
    2020-12-06 07:01

    Send an extra parameter with your GET request that will never be the same, for example, the current timestamp. Something like:

    url = url + '&nocache=' + new Date().getTime();
    

    This will prevent caching.

提交回复
热议问题