httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger <crosseyedpeng...@cox.net>
Subject Re: [users@httpd] RE : [users@httpd] Stuck trying to mod_disk_cache local cgi content
Date Mon, 25 Oct 2004 17:34:22 GMT
Axel-Stéphane SMORGRAV wrote:

>Could you put your virtual host into LogLevel debug and post the relevant parts of the
error_log??
>
>-ascs
>
>-----Message d'origine-----
>De : Roger [mailto:crosseyedpenguin@cox.net] 
>Envoyé : dimanche 17 octobre 2004 21:24
>À : users@httpd.apache.org
>Objet : [users@httpd] Stuck trying to mod_disk_cache local cgi content
>
>
>Hi,
>
>I have a python cgi application which modifies .jpg files on the fly. I 
>am trying to implement disk caching for these images. I am running 
>Windows/XP with Apache 2.0.52.
>
>The html pages created refer to the images as if they were .jpg images 
>and I use a rewrite rule to transform the request into a cgi get 
>request. So my first change was to just change the rewrite rule to force 
>a proxy request:
>    RewriteRule (^/dra/DRA_.*)___(.*)_(.*)(\.jpg$) 
>http://mysite.org/webkit/dra/ShowPix\?pid=$2\&tn=$3 [P,L]
>
>(The original purpose of the above rule was to provide a pretty default 
>file name should the user right-click and do a save as.)
>
>Per the docs, I loaded the modules and created the proxy and disk 
>caching statements:
>    LoadModule proxy_module modules/mod_proxy.so
>    LoadModule proxy_http_module modules/mod_proxy_http.so
>    LoadModule cache_module modules/mod_cache.so
>
>    ProxyRequests Off
>    <ProxyMatch .*>
>        Order deny,allow
>        Allow from all
>    </ProxyMatch>
>    LoadModule disk_cache_module modules/mod_disk_cache.so
>        CacheRoot c:/ApacheCache
>        CacheSize 1000000
>        CacheEnable disk /
>        CacheDirLevels 5
>        CacheDirLength 3
>
>The result of the above is that Apache is caching some local .css, and 
>.js files but is not caching the .jpg files covered by the rewrite rule. 
>I plan on turning off the .css and .js caching with the proxymatch 
>directive later.
>
>The script creating the .jpg images puts out headers for 
>('cache-control','max-age=3600') and the browsers I am testing with (IE, 
>Mozilla, Opera) all cache the images successfully. So everything appears 
>to be working OK except the .jpg files are not cached by Apache.
>
>Anyone have a clue as to what I am doing wrong?
>
>Roger
>
>
>  
>
Thank you, I am closer to the solution. The files are now being cached, 
but not served from the cache.

After adding LogLevel  debug to the virtual host, the first message I 
encountered was:
   ...not cached. Reason: Query string present but no expires header

So I added an expires header: equal to now plus 2 days: ('Expires', 
'Wed, 27 Oct 2004 17:43:29 GMT')

So now my images are being cached per the log, but when I view a 
particular page with these images,
delete all tempory internet files, and view the same page again, the 
files are not served from the cache.

The log with my comments is below.

The rewrite rule to change requests for a .jpg file into a querey is as 
follows:
    RewriteRule 
(^/dra/DRA_.*)___(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)(\.jpg$)
         
/webkit/dra/ShowPix\?pid=$2\&sz=$3\&ulx=$4\&uly=$5\&lrx=$6\&lry=$7\&iq=$8

[L,PT]

Roger

#
#  First access, nothing cached, this is the request for a page 
containing a .jpg image
#
[Mon Oct 25 10:14:05 2004] [debug] mod_cache.c(506): cache: 
/dra/ShowAllRockArt?Klass=14&FolderId=26&Command=Submit&spBB=B6 not 
cached. Reason: Query string present but no expires header
#
# This is activity for the target jpg image, looks as if it is getting 
cached properly
#
[Mon Oct 25 10:14:05 2004] [info] disk_cache: Storing URL 
foxdigitalrockart.org/webkit/dra/ShowPix?pid=1226&sz=224&ulx=358&uly=634&lrx=806&lry=1240&iq=75
[Mon Oct 25 10:14:05 2004] [debug] mod_cache.c(613): cache: Caching url: 
/dra/DRA_SpiralShanty_Element_3A2___1226_224_358_634_806_1240_75_0.jpg
[Mon Oct 25 10:14:05 2004] [debug] mod_disk_cache.c(613): disk_cache: 
Stored headers for URL 
foxdigitalrockart.org/webkit/dra/ShowPix?pid=1226&sz=224&ulx=358&uly=634&lrx=806&lry=1240&iq=75
[Mon Oct 25 10:14:06 2004] [debug] mod_disk_cache.c(684): disk_cache: 
Body for URL 
foxdigitalrockart.org/webkit/dra/ShowPix?pid=1226&sz=224&ulx=358&uly=634&lrx=806&lry=1240&iq=75

cached.
#
# browser cache cleared, second try for same page, this is extra junk 
getting into position for request
#
[Mon Oct 25 10:14:22 2004] [debug] mod_cache.c(506): cache: 
/dra/ShowAllRockArt?Command=Change+Class&spBB=B7 not cached. Reason: 
Query string present but no expires header
[Mon Oct 25 10:14:22 2004] [debug] mod_disk_cache.c(400): disk_cache: 
Recalled cached URL info header foxdigitalrockart.org/drastatic/ra1.css?
[Mon Oct 25 10:14:22 2004] [debug] mod_disk_cache.c(400): disk_cache: 
Recalled cached URL info header foxdigitalrockart.org/drastatic/buttons.js?
[Mon Oct 25 10:14:22 2004] [debug] mod_disk_cache.c(464): disk_cache: 
Recalled headers for URL foxdigitalrockart.org/drastatic/ra1.css?
[Mon Oct 25 10:14:22 2004] [debug] mod_cache.c(285): cache: running 
CACHE_CONDITIONAL filter
[Mon Oct 25 10:14:22 2004] [debug] mod_disk_cache.c(464): disk_cache: 
Recalled headers for URL foxdigitalrockart.org/drastatic/buttons.js?
[Mon Oct 25 10:14:22 2004] [debug] mod_cache.c(285): cache: running 
CACHE_CONDITIONAL filter
[Mon Oct 25 10:14:22 2004] [debug] mod_disk_cache.c(400): disk_cache: 
Recalled cached URL info header foxdigitalrockart.org/drastatic/logosml.jpg?
[Mon Oct 25 10:14:22 2004] [debug] mod_disk_cache.c(400): disk_cache: 
Recalled cached URL info header 
foxdigitalrockart.org/drastatic/wz_tooltip.js?
[Mon Oct 25 10:14:22 2004] [debug] mod_disk_cache.c(464): disk_cache: 
Recalled headers for URL foxdigitalrockart.org/drastatic/logosml.jpg?
[Mon Oct 25 10:14:22 2004] [debug] mod_cache.c(285): cache: running 
CACHE_CONDITIONAL filter
[Mon Oct 25 10:14:22 2004] [debug] mod_disk_cache.c(464): disk_cache: 
Recalled headers for URL foxdigitalrockart.org/drastatic/wz_tooltip.js?
[Mon Oct 25 10:14:22 2004] [debug] mod_cache.c(285): cache: running 
CACHE_CONDITIONAL filter
#
# Here comes request for same page
#
[Mon Oct 25 10:14:26 2004] [debug] mod_cache.c(506): cache: 
/dra/ShowAllRockArt?Klass=14&FolderId=26&Command=Submit&spBB=B8 not 
cached. Reason: Query string present but no expires header
#
# This image should have been served from cache, but instead it was 
recreated and stored again
#
[Mon Oct 25 10:14:27 2004] [info] disk_cache: Storing URL 
foxdigitalrockart.org/webkit/dra/ShowPix?pid=1226&sz=224&ulx=358&uly=634&lrx=806&lry=1240&iq=75
[Mon Oct 25 10:14:27 2004] [debug] mod_cache.c(613): cache: Caching url: 
/dra/DRA_SpiralShanty_Element_3A2___1226_224_358_634_806_1240_75_0.jpg
[Mon Oct 25 10:14:27 2004] [debug] mod_disk_cache.c(613): disk_cache: 
Stored headers for URL 
foxdigitalrockart.org/webkit/dra/ShowPix?pid=1226&sz=224&ulx=358&uly=634&lrx=806&lry=1240&iq=75
[Mon Oct 25 10:14:27 2004] [debug] mod_disk_cache.c(684): disk_cache: 
Body for URL 
foxdigitalrockart.org/webkit/dra/ShowPix?pid=1226&sz=224&ulx=358&uly=634&lrx=806&lry=1240&iq=75

cached.



---------------------------------------------------------------------
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


Mime
View raw message