On Mon, 20 Oct 2003, Christian Purnomo wrote:
> I then try modifying it to be:
>
> acl QUERY urlpath_regex cgi-bin \?
> acl IGNORE_CGI url_regex ^http:\/\/www.mysite.com\/cgi-bin\/
> no_cache allow IGNORE_CGI
> no_cache deny QUERY
Correct.
> I have tried turning on 'log_mime_hdrs'. The output in access.log doesn't show anything about cache-control in the headers.
>
> 066628527.970 278 192.168.10.29 TCP_MISS/200 7284 GET
> http://www.mysite.com/cgi-bin/fred.wxh?id=15&user=fred -
> DIRECT/10.0.2.78 text/html [Accept: */*\r\nAccept-Language:
> en-au\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
> 5.1)\r\nHost: www.mysite.com\r\nProxy-Connection: Keep-Alive\r\n]
> [HTTP/1.1 200 OK\r\nDate: Mon, 20 Oct 2003 05:42:07 GMT\r\nServer:
> Apache/1.3.1 (Unix)\r\nConnection: close\r\nContent-Type:
> text/html\r\n\r]
This is because your server/application is not sending any Cache-control
headers, or any other headers which would make Squid know how long it can
cache the reply. For all Squid knows (which is probably correct given the
URL) this content is dynamically generated and is not safe to cache.
Your no_cache ACL rule does not change this fact. It only allows Squid to
look into the reply to determine if it is safe to cache the content or
not. However, without your no_cache acl rule the default rule would block
caching even if the server provided adequate information.
The "Caching Tutorial for Web Authors and Webmasters"
<url:http://www.mnot.net/cache_docs/> provides a very good reference on
how to make content cacheable. This is recommended reading for anyone who
tries to make their content cacheable or not.
Regards
Henrik
Received on Mon Oct 20 2003 - 01:13:45 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:20:32 MST