Reputation: 11
I ran my site in PageSpeed. It tells me:
Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
I tried to implement it according to what they say at https://developers.google.com/speed/docs/best-practices/caching, and in some other ways.
But, so far I didn't succeed. Maybe someone can help me how to do it.
I prefer to keep only the images in the cache.
Anyway I would love to know how I can manage saving and not saving files in the cache
My site is being developed with the Google Application Engine and Java Server Pages.
Upvotes: 1
Views: 8728
Reputation: 34321
Cache-Control
is a HTTP Header that controls caching between the server and client. It is set using the HttpServletResponse
like this:
httpResponse.addHeader("Cache-Control", "max-age=60");
Where 60
is the number of seconds to cache for.
Upvotes: 2