Script to force IE8 cache behavior

in IE8, there is an option for caching tools called "always update from server". Is it possible to have some kind of javascript or similar to enforce this behavior, or should I always do it manually?

I tried

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

      

but the update issue in my application seems to be solved only by checking "update always from server" in the cache options panel.

thank

+1


source to share


1 answer


If you are using jQuery you can do:

$. AjaxSetup ({cache: false});

which solved many IE8 caching problems for me when using jquery + ajax.



Otherwise, you can use a "cache breaker" by adding a unique number to the end of the .js uri. For example:

http://mysite.com/myscript.js?=_11232131231323

Of course, a unique # could be DateTime (), which is unique for every page request.

+1


source







All Articles