Re: [squid-users] Youtube, storeurl and 302 redirection

From: Hasanen AL-Bana <hasanen_at_gmail.com>
Date: Mon, 9 Apr 2012 13:16:42 +0300

depending on the mirror & your location ,youtube will decide weather
to stream segmented videos for you or not...I have some downlinks
coming from VSAT and the script is working just fine with it, while
some other internet sources are giving me headache with 1.7M video
segments...it is not the script fault after all.

On Mon, Apr 9, 2012 at 1:06 PM, Eliezer Croitoru <eliezer_at_ngtech.co.il> wrote:
>
> On 09/04/2012 04:34, Paolo Malfatti wrote:
>>
>> Hi, i’m using storeurl.pl script to cache youtube videos files and I
>> followed instructions in:
>>
>> http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube#ConfigExamples.2BAC8-DynamicContent.2BAC8-YouTube.2BAC8-Discussion.FixedThis
>> patch don't worked for me, so I changed it a bit:1) I'd like to ignore
>> redirects, only when request is a storeurl request.2) I dont like to
>> force a MISS to "304 NOT MODIFIED" responsesWhat do you think
>> about?ThanksPaolo MalfattiCIDIS CamiriIndex:
>> src/client_side.c===================================================================---
>> src/client_side.c (revision 134)+++ src/client_side.c (working copy)@@
>> -2408,6 +2408,17 @@ is_modified = 0; } }+ /* bug fix for 302
>> moved_temporarily loop bug when using storeurl*/+ if (r->store_url &&
>> rep->sline.status >= 300 && rep->sline.status <400 && rep->sline.status
>> != 304) {+ if (httpHeaderHas(&e->mem_obj->reply->header, HDR_LOCATION))
>> {+ debug(33, 2) ("clientCacheHit: Redirect Loop
>> Detected:%s\n",http->uri);+ http->log_type = LOG_TCP_MISS;+
>> clientProcessMiss(http);+ return;+ }+ }+ /* bug fix end here*/ stale =
>> refreshCheckHTTPStale(e, r); debug(33, 2) ("clientCacheHit:
>> refreshCheckHTTPStale returned %d\n",stale); if (stale == 0) {
>>
> on what version of squid are you trying to do it?
> it works poorly and only on squid 2.X
> you can try this:
> http://code.google.com/p/youtube-cache/
> with nginx or php.
> works like a charm.
>
> Regards,
> Eliezer
>
> --
> Eliezer Croitoru
> https://www1.ngtech.co.il
> IT consulting for Nonprofit organizations
> eliezer <at> ngtech.co.il
Received on Mon Apr 09 2012 - 10:17:08 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 09 2012 - 12:00:03 MDT