Hi,
I'm configuring a squid to behave as a surrogate over a pool of
webserver (php) and a filer (a web server for static document only).
Some image and static document are not available on the php server but
only on the filer.
Here is some ascii art explaining the scheme:
squid
|
+----------+---------+-------+ filer-01
| | |
web-01 web-02 web-03
squid seems configured correctly and use a redirector to filter url over
the good webserver:
My redirector rewrites URL that way
http://domain1/img2.jpg http://filer-01/img2.jpg
http://domain3/img2.jpg http://filer-01/img2.jpg
http://domain4/img5.jpg http://filer-01/img5.jpg
http://domain5/img2.jpg http://filer-01/img2.jpg
http://domain2/img2.jpg http://filer-01/img2.jpg
http://domain1/img9.jpg http://filer-01/img9.jpg
and for php page that way :
http://domain1/page.php? http://web-01/page.php?
http://domain1/index.php http://web-02/index.php
http://domain3/page.php? http://web-03/page.php?
http://domain4/index.php http://web-01/index.php
http://domain1/page.php? http://web-02/page.php?
http://domain1/index.php http://web-03/index.php
web server are picked in round robin by the redirector.
To this point it seems working well. But the cache seems caching full
client url: http://domain1/img2.jpg, which may be a normal behavior. So
when a second client arrive with a new url, matching the same image file
http://domain2/img2.jpg, the image is not served from the cache but
reasked on the filer.
Is there a way to tell squid not to serve full source URL but only the
destination rewrote URL instead?
In my case I would like the cache to know that http://domain4/img5.jpg
== http://anotherdomain2/img5.jpg and serves img5.jpg form its cache.
Regards,
Sylvain.