Re: [squid-users] Possible? Cache images with different parameters after question-mark?

From: Manoj_Rajkarnikar <manoj@dont-contact.us>
Date: Tue, 10 Jul 2007 17:05:20 +0545 (NPT)

On Tue, 10 Jul 2007, Hermann-Marcus Behrens wrote:

> Hello,
>
> is it possible to force squid to cache an image, which never changes,
> but which is loaded with different parametes after a question-mark?
>
> Example:
> http://www.example.com/pixel.gif?page=index.html&rand=4125422
>
> I use this to measure the traffic on my webpage. A Javascript loads the
> image with different parameters (idea borrowed from Google-Analytics)
> and later a small perl-script examines the log and does some accounting.
>
> The problem: The file "pixel.gif" never changes, but due to the
> question-mark and the changing parameters squid always connects to
> apache and fetches the same file (=pixel.gif) from the apache daemon. I
> would like to config the squid in a way, that it caches the file and
> serves it from memory. Is this possible?

find the acl "QUERY" that matches cgi-bin and ?. just before this acl, add
the acl to allow caching of the file.
something like this:

acl MYDOMAIN dstdomain .example.com (match to your specific need)
cache allow MYDOMAIN
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY

hope this works

>
> Greetings from germany,
>
> Hermann-Marcus Behrens
>

-- 
Received on Tue Jul 10 2007 - 05:21:15 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Aug 01 2007 - 12:00:03 MDT