Reputation: 1912
I have an application which make multiple get requests to a web service and displays a map using that data. i use this in multiple places. since the map is taking time to load what is the best way to cache the get request?
i am thinking of the following approach
if i just use Memcache to cache the response my application still make a get request. to further optimize i can use the jquery/javascript caching and set the Http cachingheader.
is there any way other way that can be implemented to improve the performance? because i dont want to make multiple get requests across all the pages to display the same map content.
thanks
Upvotes: 0
Views: 209
Reputation: 2435
The best approach to your situation is to set Cache and Expires HTTP headers from server side, and force Jquery to use cache while making requests. If applicable, I also recommend sending Modified Date from server so After caching expires, JQuery first asks if content of the service has changed from last-modified-date.
If you successfully apply caching headers, Client side code will not issue a http request until cache time expires.
There are three main caching approaches (AFAIK) to improve performance :
Upvotes: 1