Trying again... anyone??? Bueller? :)
I'm getting closer... CacheIgnoreCacheControl helped.
There was actually one place in OpenACS that might have been adding
the cache-control header (in acs-tcl/tcl/request-processor-procs.tcl)
but I commented that out a long time ago and it didn't make any
difference.
Now, with the CacheIngoreCacheControl directive, the home page gets
cached properly. This is progress!! However, dynamic URLs are still
not being cached. For example, both of these URLs work:
translator.com/gate/gb/traditional-site.com/public/index
translator.com/gate/gb?url=traditional-site.com/public/index
The former gets cached, the latter does not.
The reason for this is that mod_cache doesn't cache URLs with query
variables unless either they contain an Expires directive or you turn
on CacheIgnoreQueryString. But the latter is rather destructive as it
returns the same content for all pages - not what one wants.
I went into the OpenACS request processor and added the expires
header; you can see it if you telnet to the page, so I know it
worked, but it's somehow not making it back to Apache (it's not in the
cached headers, and dynamic URLs are still not being cached).
Any ideas how a header could get "lost" between AOLserver and Apache?
Oh, and before anyone suggests this I did try adding an expiration via
mod_expires in Apache, but that had no effect either. I didn't really
expect it to, since that's not the request being cached, but it was
worth a try.
Thanks for everyone's patience with this mostly-OT topic!
janine
PS Here's the relevant part of my httpd.conf file:
# mod_cache/mod_mem_cache
LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
<IfModule mod_cache.c>
CacheEnable disk /
# seconds (86400 = 1 day)
CacheDefaultExpire 86400
CacheIgnoreNoLastMod On
CacheIgnoreCacheControl On
# seconds (2678400 = 31 days)
CacheMaxExpire 2678400
<IfModule mod_mem_cache.c>
# KB
#MCacheSize 524288
MCacheSize 262144
MCacheMaxObjectCount 1000
# bytes
MCacheMinObjectSize 1
# bytes
MCacheMaxObjectSize 524288
</IfModule>
<IfModule mod_disk_cache.c>
CacheRoot /var/www/cache
CacheDirLevels 1
CacheDirLength 4
CacheMaxFileSize 524288
CacheMinFileSize 1
</IfModule>
</IfModule>
#LoadModule headers_module modules/mod_headers.so
#Header set Cache-Control "max-age=999"
#LoadModule expires_module modules/mod_expires.so
#ExpiresActive On
#ExpiresDefault M86400
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
#ProxyPassMatch /(.+) http://staging-big5.hrichina.org/$1
ProxyPassMatch /(.+) http://209.162.194.27:8081/$1
On Apr 13, 2009, at 12:47 PM, David Walker wrote:
To aid your troubleshooting, I would recommend a grep or other full-
text search of the code running on AOLServer to determine if there
are any circumstances where it would generate a cache-control header.
Your telnet test may not give you all of the data you desire without
a full set of headers on the request side. The "Tamper Data" add-on
for Firefox will allow you to observe the interaction (headers and
all) between your browser and the web server.
The CacheIgnoreCacheControl directive may allow you to force Apache
to cache regardless of whether there is a cache-control directive.
http://httpd.apache.org/docs/2.0/mod/mod_cache.html
Janine Sisk wrote:
This is only peripherally related to AOLserver, but there are so
many helpful and knowledgeable people on this list, I'm hoping
someone will recognize this.
I'm still working on that Apache/Tomcat caching thing I wrote about
a few days ago. The client is insisting on Apache and nothing but
Apache, so I haven't investigated Squid, Varnish or anything else
so far.
I figured out how to use mod_cache to get Apache to cache the
content, but it's kind of useless because there's a "Cache-
Control: max-age=0" header that causes it to request a new copy
every time. The problem is, I can't figure out where it's coming
from.
I've eliminated Tomcat from the loop entirely, so the fault lies
somewhere between AOLserver and Apache:
- telnet to AOLserver directly - no cache-control at all
GET /public/index HTTP/1.0
HTTP/1.0 200 OK
Set-Cookie: ad_session_id=82810106%2c0%2c0+
%7b514+1239579021+56A366FC5E92AF28DB87E48214C6C4CE8C0581BB%7d;
Path=/; Max-Age=1200
MIME-Version: 1.0
Date: Sun, 12 Apr 2009 23:10:21 GMT
Server: AOLserver/4.0.10
Content-Type: text/html; charset=utf-8
Content-Length: 127358
Connection: close
- have Apache send request to AOLserver via mod_proxy
(ProxyPassMatch) - has Cache-Control with max-age=0
Last-Modified: Mon, 30 Mar 2009 11:26:14 GMT
MIME-Version: 1.0
Date: Sun, 12 Apr 2009 23:03:02 GMT
Server: AOLserver/4.0.10
Content-Type: image/gif
Content-Length: 395
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-
us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/
525.27.1
Referer: http://pug.furfly.com:8080/public/index
Cache-Control: max-age=0
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
- use mod_headers to add a Cache-Control header - now we have two:
Last-Modified: Mon, 30 Mar 2009 11:26:14 GMT
MIME-Version: 1.0
Date: Sun, 12 Apr 2009 23:15:04 GMT
Server: AOLserver/4.0.10
Content-Type: image/gif
Content-Length: 395
Cache-Control: max-age=999
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-
us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/
525.27.1
Referer: http://pug.furfly.com:8080/public/index
Cache-Control: max-age=0
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
It appears that Apache is adding the rogue header, but I don't know
how to tell it to stop!
Any suggestions?
janine
---
Janine Sisk
President/CEO of furfly, LLC
503-693-6407
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[email protected]
> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[email protected]
> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.
---
Janine Sisk
President/CEO of furfly, LLC
503-693-6407
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to
<[email protected]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.