tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben short" <...@benshort.co.uk>
Subject Re: HTTP 304 - IF_MODIFIED_SINCE
Date Tue, 05 Sep 2006 12:52:39 GMT
Ok,

I admit I was a bit fast going to the mailing list and I should of
done more research.

Yes you are right, I am trying not to serve resources again if they
havent changed. From what I have read I need to set the Last-Modified
header on the HttpServletResponse. The client will then send a
If-Modified-Since request header the next time it needs that resource.
I can then send HTTP Error 304 - Not modified, in return and all will
be well.

Again, thanks for your help.

Ben

On 9/5/06, Markus Schönhaber <mailing-tomcat-user@schoenhaber.de> wrote:
> ben short wrote:
> > Im using Tomcat 5.5.17. I assumed that my browser would send the
> > If-Modified-Since Request-Header and have tried your jsp page and it
> > does.
>
> OK, this shows three things:
> 1. It's much less helpful to assume things than to find out for sure. If
> you're interested in the exact request your browser generates, there are a
> couple of ways get that information. For example: the LiveHTTPHeaders
> extension for firefox, something similar for IE, tools like Wireshark (The
> Application Formerly Known As Ethereal), the HTTP monitors NetBeans and the
> WTP for eclipse provide.
> 2. The JSP I posted causes Firefox and IE to send If-Modified-Since headers on
> the second request.
> 3. The answer to your original question "How do I access the If-Modified-Since
> header field" is "like you would do for any other header field".
>
> OTOH, from what you write about your servlet, I get the impression that your
> real problem is the following: "How do I avoid to serve ressources again
> which haven't changed since the last time the client accessed them?".
> If you want to decide whether or not the client has already requested the
> actual version of the ressource by using the If-Modified-Since header field,
> you'll have to find out what causes the clients to send such a header in the
> first place. RFC 2616 might provide some hints.
>
> Regards
>   mks
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Mime
View raw message