jQuery :
*cacheBoolean
Default: true, false for dataType 'script' and 'jsonp'
If set to false, it will force requested pages not to be cached by the browser.
Setting cache to false also appends a query string parameter, "_=[TIMESTAMP]", to the URL.*
my question :
cached by the browser ???
if i have an ASHX handler which returns me :
'<div>lalala</div>'
will this be saved on the browser temporary Internet Files ?
I dont think so….
so where does it saves it ?
jQuery itself does not perform any caching of the AJAX response. Setting
cache: falseserves only to trick the browser into ignoring its own cache by adding a timestamp to the requested URL.For example, running:
Will result in a request for
/ajax_handler.php?_=1323308900002.Any subsequent request will include a newer timestamp at the end, which will cause the browser to ignore cached versions of the file and request a new copy.
So, all setting
cache: truedoes is instruct jQuery to not append this cache-busting timestamp (the current default anyway), allowing the browser to cache the file as it normally would*.In summary: any caching that happens is just regular browser caching, the files will be stored however the browser typically stores its cache.
* Note that “as it normally would” might mean not caching the file! jQuery doesn’t do anything to ensure caching, it’s up to the browser. If the page sends certain
Cache-controlorpragmaheaders, it simply won’t be cached. It would arguably make more sense for jQuery to have a “cacheBust” setting that’s the inverse ofcache, because that’s all jQuery can do: attempt to prevent caching.