Search squid archive

Re: looking for testers: google maps/earth/youtube caching

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

 



My current squid config snippets and storeurl redirector:

http://wiki.squid-cache.org/Features/StoreUrlRewrite/RewriteScript

It should work fine for the maps.google.com and related sites.
The Youtube stuff still needs tweaking.

Note that the refresh pattern needs to be early in the refresh_pattern
list, before the cgi-bin and ? refresh_pattern you should now have.
Also make sure you have removed "cache deny QUERY".




Adrian

On Tue, Nov 27, 2007, Andreas Pettersson wrote:
> I've done some testing with Google Maps using the following rewriting 
> regex and it seems to work just fine. Lot's of HITs.
> 
>  if (m/http:\/\/kh[0-3]?\.google\.com[\.a-z]*\/(.*?) /) {
>    print "http://keyhole-srv.google.com.SQUIDINTERNAL/"; . $1 . "\n";
> 
> However with YouTube I have some trouble. This is the rewriter I use:
> 
>  } elsif 
> (m/^http:\/\/\d+\.\d+\.\d+\.\d+\/get_video\?video_id=(.*?)&origin=.*?youtube\.com 
> /) {
>    # Zlatan skojar med Ekwall
>    # 
> http://74.125.10.100/get_video?video_id=hDJ7IRS4krA&origin=nyc-v23.nyc.youtube.com
>    print 
> "http://video-srv.youtube.com.SQUIDINTERNAL/get_video?video_id="; . $1 . 
> "\n";
> 
> When testing outside squid it looks ok.
> 
> # echo 
> "http://74.125.10.100/get_video?video_id=hDJ7IRS4krA&origin=nyc-v23.nyc.youtube.com 
> " | ./storeurl_rewrite.pl
> http://video-srv.youtube.com.SQUIDINTERNAL/get_video?video_id=hDJ7IRS4krA
> 
> The first fetch is of course a TCP_MISS and the debug log gives me this:
> 
> 2007/11/27 13:18:07| storeurlStart: 
> 'http://74.125.10.100/get_video?video_id=hDJ7IRS4krA&origin=nyc-v23.nyc.youtube.com'
> 2007/11/27 13:18:07| storeurlStart: sending 
> 'http://74.125.10.100/get_video?video_id=hDJ7IRS4krA&origin=nyc-v23.nyc.youtube.com 
> 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8081' to the helper
> 2007/11/27 13:18:08| storeurlHandleRead: 
> {http://video-srv.youtube.com.SQUIDINTERNAL/get_video?video_id=hDJ7IRS4krA}
> 
> Subsequent fetches (squidclient and wget) using the exact same URL are 
> TCP_HITs.
> But. If I for example change the origin part of the URL (v23 to v24):
> 
> 2007/11/27 13:24:05| storeurlStart: 
> 'http://74.125.10.100/get_video?video_id=hDJ7IRS4krA&origin=nyc-v24.nyc.youtube.com'
> 2007/11/27 13:24:05| storeurlStart: sending 
> 'http://74.125.10.100/get_video?video_id=hDJ7IRS4krA&origin=nyc-v24.nyc.youtube.com 
> 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8081' to the helper
> 2007/11/27 13:24:05| storeurlHandleRead: 
> {http://video-srv.youtube.com.SQUIDINTERNAL/get_video?video_id=hDJ7IRS4krA}
> 
> As you see, the resulting storeURL is the same as before, but the 
> request is now a TCP_SWAPFAIL_MISS.
> Shouldn't this be a HIT as well? Something I've missed?
> 
> 
> -- 
> Andreas
> 

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -

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

  Powered by Linux