本文介绍了禁用AJAX缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是有点咸菜现在。我建立一个网页,将获得的数据从一个CGI后端。我无法控制的CGI后端,也不是服务器(所以没有mod_headers中或mod_expires)。同时,由于参数传递给脚本的,我不能附加一个唯一的值(如'和; 089u0af0d98)每个请求。该请求使用Ajax XmlHtt prequest对象。我曾尝试不成功设置如果 - 修改 - 自和的Cache-Control请求头。没有任何人有任何其他的想法如何,我可以prevent被缓存在浏览器中的Ajax响应?

I am in a bit of a pickle right now. I am building a web page that will get data from a CGI backend. I have no control over the CGI backend, nor the server (so no mod_headers or mod_expires). Also, because of the parameters to the script, I cannot append a unique value (like '&089u0af0d98) to each request. The requests are AJAX using the XmlHttpRequest object. I have tried to set the 'If-Modified-Since' and 'Cache-Control' request headers unsuccessfully. Does anybody have any other ideas for how I can prevent the AJAX response from being cached by the browser?

推荐答案

您可以将使用POST随机参数,而使用GET如果您需要发送重要的增值经销商。

You can send random parameters using POST, while sending the important vars using GET if you need to.

如果你有问题,IE浏览器,我知道,送东西POST使其停止缓存服务器响应

If you have problems with IE, I know that sending something with POST makes it to stop caching server responses

这篇关于禁用AJAX缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 07:10