Any idea's how this should be solved best? I though about getParent().getClass(), but that would be very unpredictable.
Btw, has any work been done to set the cache headers of those application/ session scoped resources?
nope. that would be a good idea. when should a shared "dynamic" image expire? maybe use a good default and give the user control here?
I guess the same as session timeout would be a nice default... Johan, do you have a good idea about this one?
To be sure.. What are 'dynamic' images?
As far as i can see they are not dynamic at all . They are not created at runtime.. you only serve them from another location.
If we could get a file handle to it we could ask the modification time... But this is not possible,
So for images that are just loaded from besides the classes (so from the jar) i would send a last modification time as the
startup time of the server.. The only problem is then developing... (on the fly changes....)
Then you have the cacheable things like:
if (request.getProtocol().equals("HTTP/1.0"))
{
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", ageTime);
}
else if (request.getProtocol().equals("HTTP/1.1"))
{
response.setHeader("Cache-Control", "max-age=" + ageTime);
}
that age time can be a predefine value liek 3600 ? maybe configurable.
but the last modification is much more importand i believe:
response.setDateHeader("Last-Modified", changedDate);But that last modification should be set in the Servlet method:
protected long getLastModified(HttpServletRequest request)
{
return changedDate;
}Because that is the method that does the most magic (head request of browsers)
So we should have a servlet that can load resources from the classes/lib dir inside jars....
The best thing was to use the file stamp from something ... But i don't think this is possible..
johan
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
