Unexpected Caching of AJAX results in IE8

前端 未结 10 2233
走了就别回头了
走了就别回头了 2020-11-28 01:59

I\'m having a serious issue with Internet Explorer caching results from a JQuery Ajax request.

I have header on my web page that gets updated every time a user navig

10条回答
  •  情书的邮戳
    2020-11-28 02:25

    Just wrote a blog on this exact issue only using ExtJS (http://thecodeabode.blogspot.com/2010/10/cache-busting-ajax-requests-in-ie.html )

    The problem was as I was using a specific url rewriting format I couldn't use conventional query string params (?param=value), so I had write the cache busting parameter as a posted variable instead..... I would have thought that using POST variables are a bit safer that GET, simply because a lot of MVC frameworks use the pattern

    protocol://host/controller/action/param1/param2

    and so the mapping of variable name to value is lost, and params are simply stacked... so when using a GET cache buster parameter

    i.e. protocol://host/controller/action/param1/param2/no_cache122300201

    no_cache122300201 can be mistaken for a $param3 parameter which could have a default value

    i.e.

    public function action($param1, $param2, $param3 = "default value") { //..// }

    no chance of that happening with POSTED cache busters

提交回复
热议问题