Bug 39774 - mod_expires sets negative max-age / Expires header in the past
Summary: mod_expires sets negative max-age / Expires header in the past
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_expires (show other bugs)
Version: 2.5-HEAD
Hardware: Other All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-10 15:51 UTC by Ruediger Pluem
Modified: 2008-11-11 13:26 UTC (History)
1 user (show)



Attachments
Patch against trunk (603 bytes, patch)
2006-06-10 17:48 UTC, Ruediger Pluem
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruediger Pluem 2006-06-10 15:51:21 UTC
When using mod_expires ExpiresDefault or ExpiresByType with modifcation as base
it can happen that mod_expires adds a negative max-age to Cache-Control / an
Expires header with a date in the past. This possibly violates RFC2616.

How to reproduce:

Add

ExpiresDefault "modification plus 5 minutes"

to your config and access a static file via the webserver with a last
modification time of more then 5 minutes back from the request time.

Possible solutions:

1. mod_expires does not set an Expires header nor a max-age in this case
2. mod_expires sets Expires to the request time and max-age to 0 to indicate
that this response is not cachable.

Personally I think the second proposal is the correct solution.
Comment 1 Ruediger Pluem 2006-06-10 17:48:27 UTC
Created attachment 18444 [details]
Patch against trunk

Fixes the problem according to proposal 2: Setting max-age to 0 and Expires to
now.
Comment 2 Ruediger Pluem 2008-11-02 11:43:11 UTC
Committed to trunk as r708902.
Comment 3 Ruediger Pluem 2008-11-02 11:44:17 UTC
Proposed for backport as r709915.
Comment 4 Ruediger Pluem 2008-11-11 13:26:13 UTC
Backported to 2.2.x as r713142.