Search squid archive

Re: Possible? Cache images with different parameters after question-mark?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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


--

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux