On 06.12.2012 01:49, 金 戈 wrote:
Hi everyone!

I use squid with our ISP services.

And now we use storeurl_rewrite_program for rewrite some video cache
for our user. But after a few days draggle and google. We found it's
so difficult for us to do this. I can't find where is the error of my
configuration.And i hope someone can help.

This is my core thing about the rewrite program.
The squid.conf

acl store_rewrite_list referer_regex ^http://static.youku.com/.*$

Eliezer already pointed out the uselessness of ".*$" at the end of a pattern. What it means is "anything which ends". And notice that there is *always* an end on URLs.

I will also point out that your ACL is checking the Referer: HTTP header. From a quick scan of that website I see that ^http://static.youku.com/ matches only images, CSS and scriptlet files. None of them have sub-objects where the Referer: would be set to http://static.youku.com/...

You are perhapse wanting:
  acl store_rewrite_list referer_regex ^http://www.youku.com/

or,
  acl store_rewrite_list dstdomain static.youku.com


storeurl_access allow store_rewrite_list
storeurl_access deny all
storeurl_rewrite_program /var/squid/run/squid/store_url_rewrite.py
------------------------



FYI there are several major problems on that website which would make me steer away from storeURL re-write no this one.

In order for storeURL feature to work properly without screwing up the client responses the CDN being re-written need to be consistent and working properly. The Youku site server is presenting incorrect and inconsistently changing Vary, ETag, and Content-Type headers on a handful of the objects it is serving up (including some apparently 'static' CSS and images!), if you were to merge any of these objects using storeURL the responses sent to the client could become hopelessly corrupted.

Amos

Reply via email to