禁用AJAX缓存缓存、AJAX

由网友(北盼.)分享简介:我是有点咸菜现在。我建立一个网页,将获得的数据从一个CGI后端。我无法控制的CGI后端,也不是服务器(所以没有mod_headers中或mod_expires)。同时,由于参数传递给脚本的,我不能附加一个唯一的值(如'和; 089u0af0d98)每个请求。该请求使用Ajax XmlHtt prequest对象。我曾尝...

我是有点咸菜现在。我建立一个网页,将获得的数据从一个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

阅读全文

相关推荐

最新文章