cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27362] - Missing "Last-Modified" in ResourceReader avoids Browser Caching
Date Tue, 02 Mar 2004 12:46:38 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27362>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27362

Missing "Last-Modified" in ResourceReader avoids Browser Caching





------- Additional Comments From michael@wyraz.de  2004-03-02 12:46 -------
Sure, but i don't have cvs (write-) access. It's just a few lines to add:

File: src/java/org/apache/cocoon/reading/ResourceReader.java

Add below the lines
---
if (expires > 0) {
    response.setDateHeader("Expires", System.currentTimeMillis() + expires);
}
---

this code:

---
final long lastModified=getLastModified();
if (lastModified > 0) {
    response.setDateHeader("Last-Modified", lastModified);
}
---

This solves the problem for me (i got this code from my own reader but it should
also work with ResourceReader).

Mime
View raw message