I have an ajax call that retrieves lines from file via json.
The results retreived via json I wanted to cache, so that if a data is requested more than once, I will not send request again. what is the best practices for caching in jquery? How do I go about it?
I use php in my server side.
Any suggestions would be appreciated.
jQuery.ajax(url, {cache: true}) will tell the browser to cache the request. In fact, cache defaults to true unless the dataType setting is set to script or jsonp. In other words, you can probably use jQuery.ajax(url)