[squid-users] how to add files and url to cache by manual operation?

Amos Jeffries squid3 at treenet.co.nz
Tue Apr 21 04:26:17 UTC 2015


On 21/04/2015 2:41 p.m., 魏光 wrote:
> I saw this page "Caching YouTube Content" 
> http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube
> 
> 
> Then I have a wonder. I have the video file on my machine(not in
> squid cache) and I know the url, So if I visit the url, the machine
> would download the same video file. How can I add files to squid?

Squid does not store files. It caches HTTP. The way to update that is to
make a GET request for the URL.

> nor
> to download the same files. Can squid do that?

The URL of the file on your machine is file://localhost/... it has
nothing to do with the YouTube website. Even if you downloaded the
"file" from there originally.

The video dispayed by YouTube web page is *not* a single URL. It is a
byte stream negotiated with the YouTube server via a series of messages
flowing back and forwards containing information about the video codec,
playback speed, your network connection speed, the position in the video
you are watching, your YT account details and privacy settings, age and
adult-content applicable settings etc. The URI used changes every time
you load the page, replay the video, pause the video, fast-forward,
rewind etc.

NP: that page about YouTube has not been updated in a while so is very
likely out of date. I know they made at least one message sequence
change we do not publish details about so they wont change it again. And
the HTML5 video and VP9 codec rollouts have also changed some things.

Amos


More information about the squid-users mailing list