Wednesday, March 21, 2012

Preventing Caching of AJAX call in jquery

we have been using ajax call for quite a while now, however when used for fetching images or text files we often face cache issue where updated files are not fetched. In order to avoid this issue place following code in first line of your $(document).ready().

$.ajaxSetup ({
    // Disable caching of AJAX responses
    cache: false