开发者

HTTP PUT invalidation not working?

I do the following using XMLHTTPRequest on IE 8:

  • GET /myResource (with max-age set to a date far in the future)
  • PUT /myResource
  • GET /myResource

The last get should as far as I understand get a fresh resource from the server even if the first request has not been expired.

But IE just gets the resource out of the cache.

Is this a know开发者_开发百科n IE issue or is it correct behaviour?


This is a known IE behavior, try disabling cache, if you are using JQuery make sure cache: false, otherwise you can probably do something like this:

function random() {
    return Math.floor(Math.random()*1000);
}

And here you can append random as a variable to your request, such as:

"here/be/url?random="+random+"";

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜