开发者

HTTP PUT invalidation not working?

开发者 https://www.devze.com 2023-02-03 05:33 出处:网络
I do the following using XMLHTTPRequest on IE 8: GET /myResource (with max-age set to a date far in the future)

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

精彩评论

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