Prevent browser caching of AJAX call result

后端 未结 21 1586
醉酒成梦
醉酒成梦 2020-11-22 04:47

It looks like if I load dynamic content using $.get(), the result is cached in browser.

Adding some random string in QueryString seems to solve this iss

21条回答
  •  眼角桃花
    2020-11-22 05:14

    Maybe you should look at $.ajax() instead (if you are using jQuery, which it looks like). Take a look at: http://docs.jquery.com/Ajax/jQuery.ajax#options and the option "cache".

    Another approach would be to look at how you cache things on the server side.

提交回复
热议问题