Reputation: 62
just wanted to ask a very simple information. Does a browser by default, or after using certain response headers, cache the generated output of a jsp page into its cache and then present me with the cached output instead of a dynamic output from jsp the next time it is requested. If I am correct jsp is a servlet that gets executed in the container and then the html is generated as a response(most of the time). And I am not talking about caching the response in any container specific scope, that is altogether different, but caching the generated html in the browser cache.
Please suggest if the question is unclear.
Upvotes: 1
Views: 312
Reputation: 3290
It depends on the http headers set by the server. By default for a jsp page there is going to be something like:
cache-control: no-cache
so the jsp will not be cached. Of course the jsp can set the http headers itself to allow the caching.
See for example:
http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/ http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Upvotes: 1