RE: [squid-users] Can't get apache to set Expire headers

From: Emilia Sherifova <emilia@dont-contact.us>
Date: Thu, 1 Aug 2002 10:35:38 -0400

We use ServletExec as an application server and instead of servlets we use
jsps. In addition, we use war deployment for our web application, which
means that even images get passed on to ServletExec by apache and then
apache returns the response from the ServletExec. Because of the dynamic
nature of the jsps, I was not even trying to cache them although I would
like to. All I wanted is the ability to cache the images on the website.
Yet, with all the necessary configurations done I can't get it to work.

I also wondered, we are running Apache/1.3.20, is it possible that this
version does not set the headers?

Here is the access log from squid:

http://localhost:9811/images/pinklogo.gif - DIRECT/127.0.0.1 image/gif
1028153446.866 115 192.78.139.161 TCP_MISS/200 2617 GET
http://localhost:9811/images/navbar.gif - DIRECT/127.0.0.1 image/gif
1028153446.954 109 192.78.139.161 TCP_MISS/200 435 GET
http://localhost:9811/images/go.gif - DIRECT/127.0.0.1 image/gif
1028153446.982 114 192.78.139.161 TCP_MISS/200 855 GET
http://localhost:9811/images/sidebar_01.gif - DIRECT/127.0.0.1 image/gif
1028153447.028 277 192.78.139.161 TCP_MISS/200 10004 GET
http://localhost:9811/images/liberty.gif - DIRECT/127.0.0.1 image/gif
1028153447.062 182 192.78.139.161 TCP_MISS/200 612 GET
http://localhost:9811/images/sidebar_02.gif - DIRECT/127.0.0.1 image/gif
1028153447.102 138 192.78.139.161 TCP_MISS/200 624 GET
http://localhost:9811/images/sidebar_03.gif - DIRECT/127.0.0.1 image/gif
1028153447.143 148 192.78.139.161 TCP_MISS/200 656 GET
http://localhost:9811/images/sidebar_04.gif - DIRECT/127.0.0.1 image/gif
1028153447.172 133 192.78.139.161 TCP_MISS/200 739 GET
http://localhost:9811/images/sidebar_05.gif - DIRECT/127.0.0.1 image/gif
1028153447.202 130 192.78.139.161 TCP_MISS/200 560 GET
http://localhost:9811/images/sidebar_06.gif - DIRECT/127.0.0.1 image/gif
1028153447.222 119 192.78.139.161 TCP_MISS/200 400 GET
http://localhost:9811/images/ruler.gif - DIRECT/127.0.0.1 image/gif
1028153452.867 228 192.78.139.161 TCP_MISS/200 17886 GET
http://localhost:9811/ - DIRECT/127.0.0.1 text/html

Please let me know if you have any idea, I would be most grateful.

Thank you.

Emilia

-----Original Message-----
From: Anuradha Hegde [mailto:anuradha@onyx-systems.com]
Sent: Thursday, August 01, 2002 10:17 AM
To: squid-users@squid-cache.org
Cc: Luiz Gustavo
Subject: RE: [squid-users] Can't get apache to set Expire headers

Since you are using Servlet to build your page you can set response headers
in the Servlet code.
Use HttpServletResponse.setDateHeader("Expires", expirationDate);
    HttpServletResponse.setHeader("Cache-Control", "max-age="+setTheAge);

Hope this helps..

Anuradha

-----Original Message-----
From: Luiz Gustavo [mailto:gustavo@shoptime.com]
Sent: Wednesday, July 31, 2002 6:12 PM
To: squid-users@squid-cache.org
Subject: Re: [squid-users] Can't get apache to set Expire headers

On Wed, Jul 31, 2002 at 04:29:01PM -0400, Emilia Sherifova wrote:

> I would like to set up squid in an accelerator mode. I set it up alright
> but it would not cache any of the files. When I looked closer at the
files,
> I realized that the expire headers are not set. I made sure to install
> mod_expires in apache (when I do httpd -l, I can see mod_expires.c as
> installed).

 Works for me just using last modified. You can use your own pages to
 set expiration instead of stick with mod_expires.

> Yet, no expire header gets set. Here is what I get when I telnet to the
> website and request an image file:
>
> GET /images/logo.gif HTTP/1.1
>
> HTTP/1.0 200 OK
> Date: Wed, 31 Jul 2002 19:35:12 GMT
> Server: Apache/1.3.20 (Unix) ServletExecAS/3.1
> Content-Type: image/gif
> Content-Length: 2577
> X-Cache: MISS from eqsdev
> Connection: keep-alive

 Show what squid logs tell to you.

> I was wondering maybe it is because we use servlet engine and war files to
> deploy the web application? Or is there anything I'm doing wrong. Any
> pointers would be greatly appreaciated.

 What are you using as application server? Your static data are begin
 served by apache itself or by your app server?

--
gustavo
Received on Thu Aug 01 2002 - 08:34:02 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:09:30 MST