tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Intermittent JSP Caching/Compiling Issue while under load
Date Wed, 06 Nov 2019 20:04:08 GMT
I've found the root cause.

When checking the timestamps of JSPs, the JSP engine (because it has to
access all resources via the Servlet API) requests a URL for the JSP,
opens a connection to the URL and then checks the last modified time.
This goes directly to the on-disk file.

When reading the content, the request goes via the static resource cache
because we can intercept the call to ServletContext.getResourceAsStream()

The problem is the following sequence:
- request for JSP
  - no change in JSP timestamp found
  - cache re-validated (for 5s by default)
- JSP is modified (within 5s)
- request for JSP (within 5s)
  - change in JSP timestamp found
  - JSP content read (sees cached version rather than new version)

So we end up with the old version of the JSP content with the updated
last modification time.

I'm currently looking at options to return a URL for the resource where
we can intercept the call to URLConnection.getLastModified().

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message