Re: [squid-users] reverse proxy, url_rewrite and stored objects

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 20 May 2014 02:46:56 +1200

On 20/05/2014 12:14 a.m., Sipos Ferenc wrote:
> Hi,
>
> I have a squid proxy server (version 3.1.23) which is running in reverse
> proxy mode. I configured an url_rewrite program to increase the
> efficiency, because the same objects can reach on two urls.
> eg: these two urls are same:
> http://www.example.com/images/Test_image_1122334455.jpg
> http://www.example.com/images/11/1122334455.jpg
>
>
> Unfortunately, on the webpage both url formats are in use.
>
> So I made a rewriter program, which rewrite the
> http://www.example.com/images/Test_image_1122334455.jpg url to
> http://www.example.com/images/11/1122334455.jpg
> It works well.
>
> But the efficiency didn't increased. So I turned on the store log, and I
> saw, that the squid store the objects with original url, not the
> rewritten url. How can I configure squid to store the object associated
> with the rewritten (shorten) url not the original url?

You can but it will only fix the storage in your proxy. All other caches
will still be broken.

The best thing to do is to change your re-writer to be a true redirector
which emits a 301 permanent redirect status code telling the client the
proper URL to fetch.

Since this is a reverse proxy you would also be served well by logging
these bad-URL attempts along with the Referer: header details so you can
report to the site webmaster which of the output pages are emitted
containing obsolete/duplicate links. That way the problems can be
reduced over time.

Amos
Received on Mon May 19 2014 - 14:47:01 MDT

This archive was generated by hypermail 2.2.0 : Mon May 19 2014 - 12:00:05 MDT