即使使用mathrandom,IE8仍然会缓存我的请求 [英] IE8 is still caching my requests even with mathrandom

查看:106
本文介绍了即使使用mathrandom,IE8仍然会缓存我的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TLDR 即使网址中包含Math.random(),IE仍然会缓存我的请求。

TLDR IE is still caching my requests even with Math.random() included in the URL.

所以我将数学随机添加到我的网址末尾:

So I added math random onto the end of my url:

var MYKMLURL = 'http://' + host + 'data/pattern?key='+ Math.random();

我还在我的函数参数中添加了数学随机数:

I also added math random onto my function param:

window.setTimeout(RefreshPatternData, 1000, MYKMLLAYER);


           function RefreshPatternData(layer) {
               layer.loaded = false;
               layer.setVisibility(true);
               layer.refresh({ force: true, params: { 'key': Math.random()} });
               setTimeout(RefreshPatternData, 30000, MYKMLLAYER);
           }

因此请求显示为 http:// host / data / pattern?key = 35678652545 等。

它每次发出请求时都会更改。

It changes everytime the request is made.

适用于Firefox& Chrome& Safari等。但是IE8仍在缓存数据而不是更新我的图层。

It works in Firefox & Chrome & Safari etc. But IE8 is still caching the data and not updating my layer.

有关为什么会出现这种情况的任何想法?

Any ideas as to why this might be occuring?

所以我补充说:

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

仍在缓存数据。还有什么想法?

Still is caching the data. Any further ideas?

推荐答案

你可以试试这篇文章的答案:

You could try the answers to this post:

阻止IE缓存

这篇关于即使使用mathrandom,IE8仍然会缓存我的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆