Re: Forced caching of cgi-gifs

From: Clifton Royston <cliftonr@dont-contact.us>
Date: Tue, 8 Feb 2000 10:11:04 -1000

On Tue, Feb 08, 2000 at 03:10:57PM +0100, Alessio Sangalli wrote:
> How can I force the caching of cgi-generated gifs?
>
> I work a lot on sites wich generates _everything_ from a cgi-application,
> but the content of gifs doesn't change. Hovewer the conservative settings
> of squid request that everithing has to be requested directly from the
> remote site everytime (and that is thousands gifs in a couple of hours). I
> have to change some rules to cache every mime type gif from a particular site?

The recommended settings for the squid.conf file include (from memory)
something like:

# exact syntax on this may be wrong...
acl QUERY urlpath cgi ?
no_cache deny QUERY

This forces all output from cgi's to be non-cacheable; normally this is
the safest behavior.

What you need to do is add some patterns which will match the content
from the bogus sites, and then use that to exclude those from the
no_cache case, like this:
 
acl BOGUSSITE dst_domain .bogussite.com
acl GIFS url
# Now exclude and make cacheable all URLs ending in GIF from site...
no_cache allow BOGUSSITE QUERY GIFS
# ... before the default case
no_cache deny QUERY

If you have to do it based on the mime type returned, and can't infer
it from the URL, then I'm not sure it's straightforward.

  -- Clifton

-- 
 Clifton Royston  --  LavaNet Systems Architect --  cliftonr@lava.net
        "An absolute monarch would be absolutely wise and good.  
           But no man is strong enough to have no interest.  
             Therefore the best king would be Pure Chance.  
              It is Pure Chance that rules the Universe; 
          therefore, and only therefore, life is good." - AC
Received on Tue Feb 08 2000 - 15:30:32 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:51:01 MST