History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CACHE-70
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Unassigned
Reporter: Sander de Boer
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OSCache

last modified problem

Created: 05/Dec/03 04:38 AM   Updated: 08/Mar/07 12:29 AM
Component/s: Filters
Affects Version/s: 2.0.1
Fix Version/s: 2.1

Issue Links:
Duplicate
This issue duplicates:
CACHE-58 Check If-Modified-Since header in ca... Major Closed
 


 Description  « Hide
Hello,

I have a problem with last modified header in oscache.
All the images in my website are database images. Because I won't query the database for the same images, I made a filter and mapping in my web.xml.

<filter>
    <filter-name>Set Image Cache</filter-name>
    <filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>Set Image Cache</filter-name>
    <url-pattern>/db.images/*</url-pattern>
  </filter-mapping>

This works fine. But the last modified header are only showed at the first request.

First time:
HTTP/1.x 200 OK
Last-Modified: Fri, 05 Dec 2003 09:54:02 GMT
Date: Fri, 05 Dec 2003 09:54:02 GMT
content-disposition: inline; filename="tv portal.jpeg"
Expires: Sat, 06 Dec 2003 09:54:02 GMT
Content-Type: image/jpeg
Content-Length: 23182
Server: Apache Coyote/1.0
Connection: keep-alive

Second time:
HTTP/1.x 200 OK
Content-Type: image/jpeg
Content-Length: 23182
Date: Fri, 05 Dec 2003 09:54:02 GMT
Server: Apache Coyote/1.0
Connection: keep-alive

So, the browser couldn't cache my images.

What's the problem here?


 All   Comments   Change History      Sort Order:
Lars Torunski - [28/Mar/04 10:06 AM ]
The "Last-Modified" is very useful to improve the performance.

Kurt Williams - [20/May/04 06:47 PM ]
I've created a simple fix to this problem. With minor changes to three of the files in the Filter package, OSCache supports If-Last-Modified checking as well as returning the correct Last-Modified header.

To check out this fix, view the attachment on CACHE-58.

It's not been fully tested, but seems to work great. Perhaps it will make it into the next revision.

Chris Miller - [23/May/04 04:16 PM ]
Thanks Kurt, this fix is now in CVS