Somebody
Somebody

Reputation: 9645

jQuery - how to cache $.get request

How to cache html file forever or while ?version=1... is not added via $.get request?

I'm trying jQuery templating features, and want my templates to be cached all the time, until i'll change them.

I want to avoid unwanted requests to the server.

Upvotes: 0

Views: 620

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038810

You could set the cache: true option when performing your AJAX request to cache the response in the browser. For more effective caching you could also set the proper cache HTTP headers on the server.

Upvotes: 1

Related Questions