0

In my application, after making any changes to jsp file, changes are not picked up untill I do a refresh or clear cache.

I was wondering where is jsp stored in cache as I can see all .js, css , images files stored in temporary files folder of IE. But I could not find jsp files.

So if anyone can help me out in guiding about how the jsps are cached and where, that would be appreciated.

Update : I am only interested in knowing about the how cache works for jsp.

  1. Does it happen at client end or at server end.
  2. Is there any way to stop caching for jsps.
  3. Or whenever jsps are updated, latest copies should be fetched else they can be fetched from cache.
Onki
  • 1,879
  • 6
  • 38
  • 58
  • 1
    Jsp are on the server side. You wont see one in the browser. They are serlvets that generate resources that are sent to the browser. – BevynQ Dec 18 '14 at 05:07
  • Already has an answer here: http://stackoverflow.com/questions/8701699/where-are-the-generated-jsp-class-files-located – bobtheboy Dec 18 '14 at 05:08
  • @bobtheboy sorry but I am not asking about the location but asking about the jsp cache mechanism. Does it happen at client end or server end. And how to prevent caching. – Onki Dec 18 '14 at 07:57

2 Answers2

2

JSP caches as simple HTML file in your browser's cache. You can use this on your JSP page to prevent caching Using <meta> tags to turn off caching in all browsers?

Community
  • 1
  • 1
Anton Kolyaev
  • 306
  • 2
  • 10
0

JSP are not the static pages like HTML , they are served from your Servlet Container (i.e app server).

Once compiled they are rendered in the browser as other HTML pages does, but they not only serve static content apart from provide JSTL tag libs , support EL etc .

To turn off caching ,

<%
   response.setHeader( "Pragma", "no-cache" );
   response.setHeader( "Cache-Control", "no-cache" );
   response.setDateHeader( "Expires", 0 );
%>

does the same thing as below html tags,

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">

See Also

Community
  • 1
  • 1
Santhosh
  • 8,181
  • 4
  • 29
  • 56
  • This logic doesnot work. Please find my qsn posted here : http://stackoverflow.com/questions/27444799/how-to-verify-cache-control-no-cache-no-store-must-revalidate – Onki Dec 18 '14 at 12:37