What is the use of cache = false in ajax?

Asked

Viewed 1,807 times

4

What exactly does the Ajax code when I write:

 cache: false,

in an ajax request?

2 answers

4

The cache:false in the jQuery Ajax, serves to force requested pages not to be cached. (It’s as if you disabled the cache for that page you sent the request).

You can use both in request of the kind GET, how much HEAD

4


When we use the request many times, and it has the same return the browser saves the cache thus making it impossible to have an updated response and we end up seeing the same result, putting cache: false avoid browser save cache always keeping updated, another tip and whenever you are developing you update the page with Ctrl + F5.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.