Frederik Witte
Frederik Witte

Reputation: 1345

How to reuse cached ajax request?

I am quite new to the whole cache thing, and I am wondering how you would reuse the response of an ajax call in jQuery. From the docs(http://api.jquery.com/jquery.ajax/) I read, that cache is standard set to true, so I am wondering, when the user redirects to another page, how would I access that same response?

Upvotes: 1

Views: 138

Answers (1)

Quentin
Quentin

Reputation: 943560

You make the request using the same code as you used before.

The browser will fetch it from its cache, make a fresh request to the server, or make an If-Modified-Since request as per the cache control headers in the original response.

Upvotes: 2

Related Questions