Caching of image resources?

ansorg - November 24, 2008 - 16:28
Project:Bitcache
Version:6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Arto
Status:closed
Description

hi,

I try to use fileframework/bitcache as a replacement for the image module. I notice that images served through the fileframework do not cached in the browser, probably because the response headers for such images contain
store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=1209600
Can this be changed so that stuf from fileframework adheres to the caching settings that are defined in the "Performance" setting?

thanks

#1

miglius - November 27, 2008 - 15:36
Project:File Framework» Bitcache
Version:6.x-1.x-dev» 6.x-1.x-dev

Maybe a bitcache could adjust headers so that content pulled from the bitcache would get cached in the browser by default? The content is referenced by it's hash so it's not likely that it will change or expire :).

#2

Arto - December 1, 2008 - 16:13
Assigned to:Anonymous» Arto
Status:active» fixed

Those headers are not set by Bitcache, but rather by Drupal's core code. In release 6.x-1.0-alpha3 I've overridden the Cache-Control, Expires and Last-Modified headers set by Drupal; the relevant file is bitcache.server.inc (around line 126, in this release) and the relevant bits of the HTTP spec are:

In this latest release, the Bitcache module outputs a Cache-Control header of "private, no-transform" and an Expires header per 14.21 of the spec: "To mark a response as 'never expires,' an origin server sends an Expires date approximately one year from the time the response is sent."

This can still be much improved upon, especially by implementing full support for conditional ETag requests (the SHA-1 checksums of bitstreams conveniently serve as strong entity tags), but it's already a far sight better than the previous headers that were preventing caching altogether.

Suggestions and patches for further improvements would be most welcome.

#3

System Message - December 15, 2008 - 16:25
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.