You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "nospam@wolterinkwebdesign" <no...@wolterinkwebdesign.com> on 2007/05/22 14:17:09 UTC

Tomcat and Static file Caching ( 304 headers )

I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
of a web application.

But when i use FireBug in Firefox to track network traffic is
see that tomcat never returns a 304 NOT MODIFIED header
if a file is requested twice.

For example when requesting a JavaScript file:
http://localhost:8080/XDataSystem/standard/js/standard.js
you see the following headers:

*Response Headers*
Server 	Apache-Coyote/1.1
Etag 	W/"10823-1179768573406"
Last-Modified 	Mon, 21 May 2007 17:29:33 GMT
Content-Type 	text/javascript
Content-Encoding 	gzip
Vary 	Accept-Encoding
Date 	Tue, 22 May 2007 11:52:27 GMT
*Request Headers*
Host 	localhost:8080
User-Agent 	Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3) 
Gecko/20070309 Firefox/2.0.0.3
Accept 	*/*
Accept-Language 	nl,en-us;q=0.7,en;q=0.3
Accept-Encoding 	gzip,deflate
Accept-Charset 	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 	300
Connection 	keep-alive
Referer 	http://localhost:8080/XDataSystem/rainbow/home.page



As you can see in the response filter i have turned GZIP compressoin on.

But when i request the page again ( by typing the url in the url-bar, 
NOT using F5 )
I get the exact same response back.. But i expect a 304 response.

I think it has something to do with the Vary response field.
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js

But i do not understand it fully.

can anybody help me??
This really makes my application ( using dojo ) slow.

Thanks in advance.

Tjerk Wolterink


Re: Tomcat and Static file Caching ( 304 headers )

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Yes, you right... defaultServlet definitely supports it... in fact here is 
the section in the code
thats relevent

            long headerValue = request.getDateHeader("If-Modified-Since");
            long lastModified = resourceAttributes.getLastModified();
            if (headerValue != -1) {

                // If an If-None-Match header has been specified, if 
modified since
                // is ignored.
                if ((request.getHeader("If-None-Match") == null)
                    && (lastModified < headerValue + 1000)) {
                    // The entity has not been modified since the date
                    // specified by the client. This is not an error case.
                    response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
                    return false;
                }
            }

So initial impression is right... its looking for a
If-Modified-Since
or a
If-None-Match

from the browser.... clearly its not there...
Is that default servlet something else... beginning to wonder why I never 
use it ;)... anyway tomcat does it... and the browser is not responding.

Found another article 
http://lists.evolt.org/archive/Week-of-Mon-20060306/180529.html  guy seems 
to have same hassle you have... and in searching
I saw another article where guy has opposite problem with IE... he doesnt 
want it to cache ;)
This article got some tricks you may have to use 
http://betterexplained.com/articles/speed-up-your-javascript-load-time/

Also... if you need a reference browser... get Opera... now thats a browser.

Just a last thought.... from reading this other stuff... se wot happens if 
you change the file name... and maybe the extension to txt...

Good luck....

----- Original Message ----- 
From: "nospam@wolterinkwebdesign" <no...@wolterinkwebdesign.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, May 22, 2007 4:57 PM
Subject: Re: Tomcat and Static file Caching ( 304 headers )


> Well we are talking about static js files that do not change often.
> If was thinking about writing my own filter that created the
> correect header fields... But i think it is really a responsibility of the
> application server to support client caching for static files..
>
> It looks like tomcat does not do that.. at least not for javasdcript 
> files..
> Or the firebug firefox util is f*cked up...
> I will investigate this case.. because i think Tomcat DOES support
> cahcing ( at least if i look at the code of DefaultServlet that handles
> the static files in tomcat )..
> But strangely enough it does not work for me..
>
>
> Johnny Kewl schreef:
>> I just had an after thought... happens often ; )
>> I think because you using feed type technology the assumption is that is 
>> wot you really want,
>> but if this js file never changes... then wot about trying normal caching 
>> constructs like
>>
>> please check the actual format...
>>     Cache-control: public, max-age=3600
>> I think that will cache the js page for one hour.... alot easier than 
>> hashing pages and all the other fancy stuff in feeds.... maybe.
>>
>> ----- Original Message ----- From: "Johnny Kewl" <jo...@kewlstuff.co.za>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Tuesday, May 22, 2007 3:55 PM
>> Subject: Re: Tomcat and Static file Caching ( 304 headers )
>>
>>
>>> Hi... I dont know much about this, never had a chance to play with it... 
>>> dont even
>>> know how much Tomcat does for you and how much is manual header 
>>> manipulation.
>>> But just from below... there seems to be nothing in the browser response 
>>> telling the server
>>> that it understands feed caching... ie one would expect to see
>>> Last-Modified:  or Etag... so just guessing but I dont think the browser 
>>> understands it..
>>> maybe you should try Last-Modified....
>>>
>>> I found a fairly decent article.... maybe will help... 
>>> http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds
>>>
>>> ----- Original Message ----- From: "nospam@wolterinkwebdesign" 
>>> <no...@wolterinkwebdesign.com>
>>> To: <us...@tomcat.apache.org>
>>> Sent: Tuesday, May 22, 2007 2:17 PM
>>> Subject: Tomcat and Static file Caching ( 304 headers )
>>>
>>>
>>>> I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
>>>> of a web application.
>>>>
>>>> But when i use FireBug in Firefox to track network traffic is
>>>> see that tomcat never returns a 304 NOT MODIFIED header
>>>> if a file is requested twice.
>>>>
>>>> For example when requesting a JavaScript file:
>>>> http://localhost:8080/XDataSystem/standard/js/standard.js
>>>> you see the following headers:
>>>>
>>>> *Response Headers*
>>>> Server Apache-Coyote/1.1
>>>> Etag W/"10823-1179768573406"
>>>> Last-Modified Mon, 21 May 2007 17:29:33 GMT
>>>> Content-Type text/javascript
>>>> Content-Encoding gzip
>>>> Vary Accept-Encoding
>>>> Date Tue, 22 May 2007 11:52:27 GMT
>>>
>>>> *Request Headers*
>>>> Host localhost:8080
>>>> User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
>>>> Gecko/20070309 Firefox/2.0.0.3
>>>> Accept */*
>>>> Accept-Language nl,en-us;q=0.7,en;q=0.3
>>>> Accept-Encoding gzip,deflate
>>>> Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
>>>> Keep-Alive 300
>>>> Connection keep-alive
>>>> Referer http://localhost:8080/XDataSystem/rainbow/home.page
>>>>
>>>>
>>>>
>>>> As you can see in the response filter i have turned GZIP compressoin 
>>>> on.
>>>>
>>>> But when i request the page again ( by typing the url in the url-bar,
>>>> NOT using F5 )
>>>> I get the exact same response back.. But i expect a 304 response.
>>>>
>>>> I think it has something to do with the Vary response field.
>>>> I have read this:
>>>> http://localhost:8080/XDataSystem/standard/js/standard.js
>>>>
>>>> But i do not understand it fully.
>>>>
>>>> can anybody help me??
>>>> This really makes my application ( using dojo ) slow.
>>>>
>>>> Thanks in advance.
>>>>
>>>> Tjerk Wolterink
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: [solved] Tomcat and Static file Caching ( 304 headers )

Posted by "nospam@wolterinkwebdesign" <no...@wolterinkwebdesign.com>.
Sorry to your all.. Tomcat does do correct caching..
The way that firebug displays this is a bit strange..

My fault

nospam@wolterinkwebdesign schreef:
> Well we are talking about static js files that do not change often.
> If was thinking about writing my own filter that created the
> correect header fields... But i think it is really a responsibility of 
> the
> application server to support client caching for static files..
>
> It looks like tomcat does not do that.. at least not for javasdcript 
> files..
> Or the firebug firefox util is f*cked up...
> I will investigate this case.. because i think Tomcat DOES support
> cahcing ( at least if i look at the code of DefaultServlet that handles
> the static files in tomcat )..
> But strangely enough it does not work for me..
>
>
> Johnny Kewl schreef:
>> I just had an after thought... happens often ; )
>> I think because you using feed type technology the assumption is that 
>> is wot you really want,
>> but if this js file never changes... then wot about trying normal 
>> caching constructs like
>>
>> please check the actual format...
>>     Cache-control: public, max-age=3600
>> I think that will cache the js page for one hour.... alot easier than 
>> hashing pages and all the other fancy stuff in feeds.... maybe.
>>
>> ----- Original Message ----- From: "Johnny Kewl" <jo...@kewlstuff.co.za>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Tuesday, May 22, 2007 3:55 PM
>> Subject: Re: Tomcat and Static file Caching ( 304 headers )
>>
>>
>>> Hi... I dont know much about this, never had a chance to play with 
>>> it... dont even
>>> know how much Tomcat does for you and how much is manual header 
>>> manipulation.
>>> But just from below... there seems to be nothing in the browser 
>>> response telling the server
>>> that it understands feed caching... ie one would expect to see
>>> Last-Modified:  or Etag... so just guessing but I dont think the 
>>> browser understands it..
>>> maybe you should try Last-Modified....
>>>
>>> I found a fairly decent article.... maybe will help... 
>>> http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds
>>>
>>> ----- Original Message ----- From: "nospam@wolterinkwebdesign" 
>>> <no...@wolterinkwebdesign.com>
>>> To: <us...@tomcat.apache.org>
>>> Sent: Tuesday, May 22, 2007 2:17 PM
>>> Subject: Tomcat and Static file Caching ( 304 headers )
>>>
>>>
>>>> I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
>>>> of a web application.
>>>>
>>>> But when i use FireBug in Firefox to track network traffic is
>>>> see that tomcat never returns a 304 NOT MODIFIED header
>>>> if a file is requested twice.
>>>>
>>>> For example when requesting a JavaScript file:
>>>> http://localhost:8080/XDataSystem/standard/js/standard.js
>>>> you see the following headers:
>>>>
>>>> *Response Headers*
>>>> Server Apache-Coyote/1.1
>>>> Etag W/"10823-1179768573406"
>>>> Last-Modified Mon, 21 May 2007 17:29:33 GMT
>>>> Content-Type text/javascript
>>>> Content-Encoding gzip
>>>> Vary Accept-Encoding
>>>> Date Tue, 22 May 2007 11:52:27 GMT
>>>
>>>> *Request Headers*
>>>> Host localhost:8080
>>>> User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
>>>> Gecko/20070309 Firefox/2.0.0.3
>>>> Accept */*
>>>> Accept-Language nl,en-us;q=0.7,en;q=0.3
>>>> Accept-Encoding gzip,deflate
>>>> Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
>>>> Keep-Alive 300
>>>> Connection keep-alive
>>>> Referer http://localhost:8080/XDataSystem/rainbow/home.page
>>>>
>>>>
>>>>
>>>> As you can see in the response filter i have turned GZIP 
>>>> compressoin on.
>>>>
>>>> But when i request the page again ( by typing the url in the url-bar,
>>>> NOT using F5 )
>>>> I get the exact same response back.. But i expect a 304 response.
>>>>
>>>> I think it has something to do with the Vary response field.
>>>> I have read this:
>>>> http://localhost:8080/XDataSystem/standard/js/standard.js
>>>>
>>>> But i do not understand it fully.
>>>>
>>>> can anybody help me??
>>>> This really makes my application ( using dojo ) slow.
>>>>
>>>> Thanks in advance.
>>>>
>>>> Tjerk Wolterink
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: Tomcat and Static file Caching ( 304 headers )

Posted by "nospam@wolterinkwebdesign" <no...@wolterinkwebdesign.com>.
Well we are talking about static js files that do not change often.
If was thinking about writing my own filter that created the
correect header fields... But i think it is really a responsibility of the
application server to support client caching for static files..

It looks like tomcat does not do that.. at least not for javasdcript files..
Or the firebug firefox util is f*cked up...
I will investigate this case.. because i think Tomcat DOES support
cahcing ( at least if i look at the code of DefaultServlet that handles
the static files in tomcat )..
But strangely enough it does not work for me..


Johnny Kewl schreef:
> I just had an after thought... happens often ; )
> I think because you using feed type technology the assumption is that 
> is wot you really want,
> but if this js file never changes... then wot about trying normal 
> caching constructs like
>
> please check the actual format...
>     Cache-control: public, max-age=3600
> I think that will cache the js page for one hour.... alot easier than 
> hashing pages and all the other fancy stuff in feeds.... maybe.
>
> ----- Original Message ----- From: "Johnny Kewl" <jo...@kewlstuff.co.za>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Tuesday, May 22, 2007 3:55 PM
> Subject: Re: Tomcat and Static file Caching ( 304 headers )
>
>
>> Hi... I dont know much about this, never had a chance to play with 
>> it... dont even
>> know how much Tomcat does for you and how much is manual header 
>> manipulation.
>> But just from below... there seems to be nothing in the browser 
>> response telling the server
>> that it understands feed caching... ie one would expect to see
>> Last-Modified:  or Etag... so just guessing but I dont think the 
>> browser understands it..
>> maybe you should try Last-Modified....
>>
>> I found a fairly decent article.... maybe will help... 
>> http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds
>>
>> ----- Original Message ----- From: "nospam@wolterinkwebdesign" 
>> <no...@wolterinkwebdesign.com>
>> To: <us...@tomcat.apache.org>
>> Sent: Tuesday, May 22, 2007 2:17 PM
>> Subject: Tomcat and Static file Caching ( 304 headers )
>>
>>
>>> I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
>>> of a web application.
>>>
>>> But when i use FireBug in Firefox to track network traffic is
>>> see that tomcat never returns a 304 NOT MODIFIED header
>>> if a file is requested twice.
>>>
>>> For example when requesting a JavaScript file:
>>> http://localhost:8080/XDataSystem/standard/js/standard.js
>>> you see the following headers:
>>>
>>> *Response Headers*
>>> Server Apache-Coyote/1.1
>>> Etag W/"10823-1179768573406"
>>> Last-Modified Mon, 21 May 2007 17:29:33 GMT
>>> Content-Type text/javascript
>>> Content-Encoding gzip
>>> Vary Accept-Encoding
>>> Date Tue, 22 May 2007 11:52:27 GMT
>>
>>> *Request Headers*
>>> Host localhost:8080
>>> User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
>>> Gecko/20070309 Firefox/2.0.0.3
>>> Accept */*
>>> Accept-Language nl,en-us;q=0.7,en;q=0.3
>>> Accept-Encoding gzip,deflate
>>> Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
>>> Keep-Alive 300
>>> Connection keep-alive
>>> Referer http://localhost:8080/XDataSystem/rainbow/home.page
>>>
>>>
>>>
>>> As you can see in the response filter i have turned GZIP compressoin 
>>> on.
>>>
>>> But when i request the page again ( by typing the url in the url-bar,
>>> NOT using F5 )
>>> I get the exact same response back.. But i expect a 304 response.
>>>
>>> I think it has something to do with the Vary response field.
>>> I have read this:
>>> http://localhost:8080/XDataSystem/standard/js/standard.js
>>>
>>> But i do not understand it fully.
>>>
>>> can anybody help me??
>>> This really makes my application ( using dojo ) slow.
>>>
>>> Thanks in advance.
>>>
>>> Tjerk Wolterink
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>


---------------------------------------------------------------------
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


Re: Tomcat and Static file Caching ( 304 headers )

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
I just had an after thought... happens often ; )
I think because you using feed type technology the assumption is that is wot 
you really want,
but if this js file never changes... then wot about trying normal caching 
constructs like

please check the actual format...
     Cache-control: public, max-age=3600
I think that will cache the js page for one hour.... alot easier than 
hashing pages and all the other fancy stuff in feeds.... maybe.

----- Original Message ----- 
From: "Johnny Kewl" <jo...@kewlstuff.co.za>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, May 22, 2007 3:55 PM
Subject: Re: Tomcat and Static file Caching ( 304 headers )


> Hi... I dont know much about this, never had a chance to play with it... 
> dont even
> know how much Tomcat does for you and how much is manual header 
> manipulation.
> But just from below... there seems to be nothing in the browser response 
> telling the server
> that it understands feed caching... ie one would expect to see
> Last-Modified:  or Etag... so just guessing but I dont think the browser 
> understands it..
> maybe you should try Last-Modified....
>
> I found a fairly decent article.... maybe will help... 
> http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds
>
> ----- Original Message ----- 
> From: "nospam@wolterinkwebdesign" <no...@wolterinkwebdesign.com>
> To: <us...@tomcat.apache.org>
> Sent: Tuesday, May 22, 2007 2:17 PM
> Subject: Tomcat and Static file Caching ( 304 headers )
>
>
>>I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
>> of a web application.
>>
>> But when i use FireBug in Firefox to track network traffic is
>> see that tomcat never returns a 304 NOT MODIFIED header
>> if a file is requested twice.
>>
>> For example when requesting a JavaScript file:
>> http://localhost:8080/XDataSystem/standard/js/standard.js
>> you see the following headers:
>>
>> *Response Headers*
>> Server Apache-Coyote/1.1
>> Etag W/"10823-1179768573406"
>> Last-Modified Mon, 21 May 2007 17:29:33 GMT
>> Content-Type text/javascript
>> Content-Encoding gzip
>> Vary Accept-Encoding
>> Date Tue, 22 May 2007 11:52:27 GMT
>
>> *Request Headers*
>> Host localhost:8080
>> User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
>> Gecko/20070309 Firefox/2.0.0.3
>> Accept */*
>> Accept-Language nl,en-us;q=0.7,en;q=0.3
>> Accept-Encoding gzip,deflate
>> Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
>> Keep-Alive 300
>> Connection keep-alive
>> Referer http://localhost:8080/XDataSystem/rainbow/home.page
>>
>>
>>
>> As you can see in the response filter i have turned GZIP compressoin on.
>>
>> But when i request the page again ( by typing the url in the url-bar,
>> NOT using F5 )
>> I get the exact same response back.. But i expect a 304 response.
>>
>> I think it has something to do with the Vary response field.
>> I have read this:
>> http://localhost:8080/XDataSystem/standard/js/standard.js
>>
>> But i do not understand it fully.
>>
>> can anybody help me??
>> This really makes my application ( using dojo ) slow.
>>
>> Thanks in advance.
>>
>> Tjerk Wolterink
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: Tomcat and Static file Caching ( 304 headers )

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Hi... I dont know much about this, never had a chance to play with it... 
dont even
know how much Tomcat does for you and how much is manual header 
manipulation.
But just from below... there seems to be nothing in the browser response 
telling the server
that it understands feed caching... ie one would expect to see
Last-Modified:  or Etag... so just guessing but I dont think the browser 
understands it..
maybe you should try Last-Modified....

I found a fairly decent article.... maybe will help... 
http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds

----- Original Message ----- 
From: "nospam@wolterinkwebdesign" <no...@wolterinkwebdesign.com>
To: <us...@tomcat.apache.org>
Sent: Tuesday, May 22, 2007 2:17 PM
Subject: Tomcat and Static file Caching ( 304 headers )


>I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
> of a web application.
>
> But when i use FireBug in Firefox to track network traffic is
> see that tomcat never returns a 304 NOT MODIFIED header
> if a file is requested twice.
>
> For example when requesting a JavaScript file:
> http://localhost:8080/XDataSystem/standard/js/standard.js
> you see the following headers:
>
> *Response Headers*
> Server Apache-Coyote/1.1
> Etag W/"10823-1179768573406"
> Last-Modified Mon, 21 May 2007 17:29:33 GMT
> Content-Type text/javascript
> Content-Encoding gzip
> Vary Accept-Encoding
> Date Tue, 22 May 2007 11:52:27 GMT

> *Request Headers*
> Host localhost:8080
> User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
> Gecko/20070309 Firefox/2.0.0.3
> Accept */*
> Accept-Language nl,en-us;q=0.7,en;q=0.3
> Accept-Encoding gzip,deflate
> Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive 300
> Connection keep-alive
> Referer http://localhost:8080/XDataSystem/rainbow/home.page
>
>
>
> As you can see in the response filter i have turned GZIP compressoin on.
>
> But when i request the page again ( by typing the url in the url-bar,
> NOT using F5 )
> I get the exact same response back.. But i expect a 304 response.
>
> I think it has something to do with the Vary response field.
> I have read this:
> http://localhost:8080/XDataSystem/standard/js/standard.js
>
> But i do not understand it fully.
>
> can anybody help me??
> This really makes my application ( using dojo ) slow.
>
> Thanks in advance.
>
> Tjerk Wolterink
>
> 


---------------------------------------------------------------------
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


Re: Tomcat and Static file Caching ( 304 headers )

Posted by "nospam@wolterinkwebdesign" <no...@wolterinkwebdesign.com>.
There is one typo:

--
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js
--

Must be replaces by:

--
I have read this:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44
--

( Sorry, Copy-Paste error )

nospam@wolterinkwebdesign schreef:
> I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
> of a web application.
>
> But when i use FireBug in Firefox to track network traffic is
> see that tomcat never returns a 304 NOT MODIFIED header
> if a file is requested twice.
>
> For example when requesting a JavaScript file:
> http://localhost:8080/XDataSystem/standard/js/standard.js
> you see the following headers:
>
> *Response Headers*
> Server     Apache-Coyote/1.1
> Etag     W/"10823-1179768573406"
> Last-Modified     Mon, 21 May 2007 17:29:33 GMT
> Content-Type     text/javascript
> Content-Encoding     gzip
> Vary     Accept-Encoding
> Date     Tue, 22 May 2007 11:52:27 GMT
> *Request Headers*
> Host     localhost:8080
> User-Agent     Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; 
> rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
> Accept     */*
> Accept-Language     nl,en-us;q=0.7,en;q=0.3
> Accept-Encoding     gzip,deflate
> Accept-Charset     ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive     300
> Connection     keep-alive
> Referer     http://localhost:8080/XDataSystem/rainbow/home.page
>
>
>
> As you can see in the response filter i have turned GZIP compressoin on.
>
> But when i request the page again ( by typing the url in the url-bar, 
> NOT using F5 )
> I get the exact same response back.. But i expect a 304 response.
>
> I think it has something to do with the Vary response field.
> I have read this:
> http://localhost:8080/XDataSystem/standard/js/standard.js
>
> But i do not understand it fully.
>
> can anybody help me??
> This really makes my application ( using dojo ) slow.
>
> Thanks in advance.
>
> Tjerk Wolterink
>
>


---------------------------------------------------------------------
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