Disabling Caching on All AJAX in jQuery

Sharing is Caring

It’s no secret that many of us that use javascript regularly love jQuery because it handles a lot of the cross browser issues and makes our lives so much easier.

The .ajax function makes use of caching by default, but we can override this by creating a function called .ajaxSetup and adding cache: false in the function.

$.ajaxSetup ({
    cache: false
});

You can of course take advantage of this and create even more verbose .ajax calls. 😉

Author: Brian Cline

Brian is a programmer living in Niagara Falls with ten years of development experience. He is passionate about automation, business process re-engineering, and gamification. For the last six years or so, he has been working with Salesforce and JavaScript.

Related Posts

Sharing is Caring