where can we add code to actually compare the last modified
and if-modified-since dates ?
-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 20, 2001 10:55 AM
To: [EMAIL PROTECTED]
Subject: Re: Patch to bug #345 complete ?
On Mon, 20 Aug 2001, Justin Erenkrantz wrote:
> On Mon, Aug 20, 2001 at 10:24:01AM -0700, Henry Yeh wrote:
> >
> > yes. I analyzed the HTTP header that's being sent and received by the
> > browser.
> > If-Modified-Since messages are sent to tomcat, and we are dealing with
> > static files here (javascript and images).
> > So is tomcat doesn't have the '304 behavior' for static files ? It does
> > send back 'last-modified' date information in the header, and that
ALWAYS
> > matches the 'If-modified-since' date. Are we looking at another tomcat
> > date bug here ?
>
> It's more of a feature that was never written. Tomcat has no code to
> handle If-Modified-Since (based on a quick grep through the source
> code - I could be wrong). You are welcome to write the code and apply
> it locally. I'm not sure if it'll make it into the 3.x branch as I
> think it is frozen. 4.x is a possibility for inclusion, however. (I
> seem to remember that you are using 3.x.)
>
> However, you'll have to be aware that jsp's and servlets must ignore
> If-Modified-Since headers so the implementation can be tricky.
I'm not sure I would make quite so blanket a statement as that. If the
servlet itself understands that the content it produces changes rarely, it
can improve performance by respecting If-Modified-Since values. To make
this worthwhile, though, it will also need to control the value sent for
the "Last-Modified" header, which you can do by overriding the
getLastModified() method of HttpServlet.
> -- justin
>
>
For what it's worth, Tomcat 4 stand-alone already correctly handles
If-Modified-Since headers, and sends back "not modified" responses
appropriately.
Craig