-
Playing with Caching (2 messages)
- Posted by: JavaMan J
- Posted on: December 30 2006 07:25 EST
HI For my application i have a caching mechansim whcih sets the expiry date to the static contents.(js,css and image files). For this i have a Filter class whcih extends javax.servlet.Filter whcih sets the expiry date. httpservletresponse.addDateHeader("Expires", 0); But in case i change the a js file in the future, then i want this file to be requested again from the server though it has been cached prevoisly. I tried to inlude public long getLastModified(HttpServletRequest req)in my jsp but doesnt even get called.Not sure How to handle this? Is there any other mechanism to handle such cases?Threaded Messages (2)
- Elaborate? by Thomas Fabricius-Bjerre on January 03 2007 02:27 EST
- Re: Playing with Caching by Dmitry Namiot on January 05 2007 06:55 EST
-
Elaborate?[ Go to top ]
- Posted by: Thomas Fabricius-Bjerre
- Posted on: January 03 2007 02:27 EST
- in response to JavaMan J
Hi, I'm not sure I understand what your problem is. Is it your httpfilter that caches your resource files (js, css etc..)? And when a new file is uploaded you need the server to flush the cache? First option: Is that cache needed? Moving files in and out of cache isn't cheap. Skip the cache. Second option: Let the filter decide what to do. Every day, when the first request enters: Flush the cache. Third option: Make an url that activates a servlet that flushes your cache. -
Re: Playing with Caching[ Go to top ]
- Posted by: Dmitry Namiot
- Posted on: January 05 2007 06:55 EST
- in response to JavaMan J
See cache filter in JSOS: http://www.servletsuite.com/servlets.htm