You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris Diacov <ch...@activevideotools.com> on 2003/06/09 08:47:36 UTC

[users@httpd] Strange mod_expires problem with Apache 2.0.45 (win32)

Hello,

I have a strange problem with mod_expires in Apache 2.0.45 running on
Windows 2000 Server.

Here is the setup info:

- Windows 2000 server, latest service pack and hotfixes
- Apache 2.0.45 standard Win32 binary distribution
- mod_expires enabled and loaded
- JRun4 jrun_module enabled and loaded

I'm trying to force immediate expiration for any JSP and HTML content but
leave any images in the browser cache for up to a month. I have set
ExpiresActive to ON. I'm trying to use ExpiresDefault and ExpiresByType to
define individual expiration rules for the following mime-types: image/jpeg,
image/gif, text/html and text/plain. My general conclusion is, that
ExpiresByType does not work as expected. If I set ExpiresDefault, all files
served contain the expiration header defined by it (although the response
shows the proper mime-type, so I would expect the header to comply with the
value of ExpiresByType for image/gif). Here are the relevant httpd.conf
part, a sample request and response:

--------------------------------------------------------------------

<httpd.conf>

ExpiresActive on
#Images expire in a month
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
#HTML expires immediately
ExpiresByType text/html A0
ExpiresByType text/plain A0
#Default expires in a day
ExpiresDefault A86400

</httpd.conf>

GET /img/aniFreeMemb.gif HTTP/1.1
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
1.0.3705; .NET CLR 1.0.2914)
Host: mysubdomain.mydomain.com:8080
Connection: Keep-Alive
Cookie: JSESSIONID=ba302627171054241112468

HTTP/1.1 200 OK
Date: Thu, 29 May 2003 21:12:50 GMT
Server: Apache/2.0.45 (Win32)
Cache-Control: max-age=86400
Expires: Fri, 30 May 2003 21:12:50 GMT
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/gif

--------------------------------------------------------------------


If I disable ExpiresDefault, the response doesn't get ANY expiration
headers.  Here are the relevant httpd.conf part, a sample request and
response:


--------------------------------------------------------------------

<httpd.conf>

ExpiresActive on
#Images expire in a month
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
#HTML expires immediately
ExpiresByType text/html A0
ExpiresByType text/plain A0
#Default expires in a day
#ExpiresDefault A86400

</httpd.conf>

GET /img/aniFreeMemb.gif HTTP/1.1
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
1.0.3705; .NET CLR 1.0.2914)
Host: mysubdomain.mydomain.com:8080
Connection: Keep-Alive
Cookie: JSESSIONID=ba302627171054241112468


HTTP/1.1 200 OK
Date: Thu, 29 May 2003 21:10:28 GMT
Server: Apache/2.0.45 (Win32)
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/gif

--------------------------------------------------------------------

In both examples above I'm doing a single request for the image file
"aniFreeMemb.gif" itself, not a request for the page that links to the file.

Now, I might be missing something very obvious. Actually, I hope this is the
case, as I badly need to make this work - I have to serve pages which change
dynamically, but have plenty of images on them which are pretty much static.
If this is a version-specific problem, I'll be glad to get feedback from
somebody who has this working on another version - I don't mind downgrading
my server if I have to.

Any help and/or pointers will be greatly appreciated.

Chris


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org