Videocache is no longer in development.


by Anonymous on 23 Nov 2008

It would be great if you can add TOS/DSCP support for youtube_cache , it will stream the videos to my users and bypass the download limits

28 Answers

by Kulbir Saini on 23 Nov 2008

TOS/DSCP is a squid thing and you can set that in squid configuration itself. Youtube Cache is just a plugin to help squid in caching dynamic videos served by various websites.

by Anonymous on 23 Nov 2008

you are right , but take a look at this from access.log TCP_MISS/200 8266426 GET

as you can see ,the video is being retrieved from the video_cache , but it is coming as a miss , is it possible to return it as a HIT.
This way TOS/DSCP will work with youtube

by Kulbir Saini on 24 Nov 2008

Actually redirectors/url rewriters or other squid plugins are not allowed to do set TOS/DSCP. So there is almost nothing that can be done about it. Though I am exploring the possibilities, I have little hope :|

by Anonymous2 on 14 Jan 2009

well, you could use netfilter for that. set TOS/DSCP to everything going out from your local apache port.

by Kulbir Saini on 19 Jan 2009


Thanks for the suggestions. I hope this will help people wanting TOS/DSCP :)

Thank You!

by Anonymous on 25 Feb 2009

please any example of using netfilter for a newbie in linux .. its so important to change the tos of hit video file ..

by Anonymous on 25 Feb 2009

whats the (( local apache port. )) ?? is it 80 ??

by Kulbir Saini on 25 Feb 2009


Yes, it is 80 by default.

by Anonymous on 25 Feb 2009

so , should i put this in debian IP-table :

iptables –A OUTPUT –t mangle –sp 80 –set-tos 0x30

is this correct for debian ? i think it needs some corrections ..

by Kulbir Saini on 25 Feb 2009


I am not good at iptables. May be some other member will help or try asking in some iptables forums.

Thank You!

by imriz on 25 Feb 2009

I suggest using a uid/gid match, and not by port.

by Kulbir Saini on 25 Feb 2009


As far as I know, newer kernels doesn't allow matching using uid/gid . Correct me if I am wrong.

Thank You!

by imriz on 25 Feb 2009

Uhmm, the iptables man page on a RHEL 5.3 machine indicates it is supported, but I haven't tried that my self.

by Anonymous on 26 Feb 2009

I tried uid/gid , the problem is the packets output from apache is going to squid , its not going out from the output interface to mikrotik directly .. so it wont be marked by matching the uid/gid ..
only the packets out from the interface will be marked , which are coming from squid not apache ..
also tried the port 80 , same thing ..

by imriz on 26 Feb 2009

Why would you route the apache through the squid??
If this is a transparent proxy, like in my setup, you should make sure that access to the apache should go directly to the apache and not through squid.

by Anonymous on 26 Feb 2009

well , i dont think its routed through squid , and squid is transparnet also ..
but all packets coming to mikrotik from the cache server are coming from serverIP:squid port .. even cached youtube packets not from serverIP:apache port ..
so that i guess all packets requested by mikrotik should come from the squid port ..
I test if i request somthing directly from apache , yes it's working , easily i can change its DSCP using IP-table output uid=www-data, and mikrotik can recognize it ..
if my conclusion is right , so the question is if a packet come from apache with a specific dscp value , how can we keep this value untill it reaches mikrotik , i mean we dont want squid to change the packets dscp .. may be the reason is that zph is doing this for miss packets ? i mean we have to make zph changes only dscp of hit packets , and leaves the miss packets as it is ..

by imriz on 27 Feb 2009

You need an iptables rule to avoid redirecting traffic to the apache into squid. Something like this:

iptables -t nat -A PREROUTING -i  <yourincominginterface> -s !  <yourserverip> -d !  <yourserverip> -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
by Anonymous on 28 Feb 2009

maybe i should be more clear about my setup :
videocahe + squid installed in single interface server , connected to mikrotik through this interface ..
the request coming from mikrotik to squid:3128 ..
your last example rule is to redirecting every packets coming from the interface , not from squid ip , not going to squid ip , has dst port 80 , to be redirected to port 3128 !!!!
which i cant understand !!!!!!!!!!!!!!

by Anonymous on 1 Mar 2009

yesssss I did it , finally

now any cached video is downloading by clients is in unlimited speed !!!!!!!!!

thanks alot my friends for all of your great suggestions ..

actually i did it by the mikrotik itself , marking the squidIP:80 ..

by Anonymous on 1 Mar 2009

sorry for my bad english

you wrote


yesssss I did it , finally

now any cached video is downloading by clients is in unlimited speed !!!!!!!!!

thanks alot my friends for all of your great suggestions ..

actually i did it by the mikrotik itself , marking the squidIP:80 ..

can you help me ? what is "squidIP:80 --" i need the rule you add in a /ip firewall mangle


by Jorge Boardman on 10 Apr 2009

Hi there, You finally made it, !!! Marking connections/packets coming from your SquidIP:80 ... but this way aren't you allowing ALL packets coming from SquidIP:80 at full speed? Even the packets that have not been cached yet or packets that are un-cacheable ... so actually not controlling HTTP bandwidth to your clients... or am I wrong?

by Kulbir Saini on 10 Apr 2009


The traffic squidIP:80 means the HTTP traffic from a webserver running on squid machine. While the other HTTP traffic served to clients is search via squidIP:squidPort and not squidIP:80. So, you are basically not allowing all the traffic at full speed.

Thank You!

by Jorge Boardman on 11 Apr 2009

Thanks for the point, I analyzed these later and certainly you are right.



by My Problem with mikro tik on 4 May 2009


i have problem with mikrotik i see all reply but i do not understand now how to set mikrotik to listin to cachevideo i have problem with play the video ( An error occurred, please try again later.) in mikrotik only

but in set the proxy:ip and proxy:3128 in firefox it is working good

all file it is caching good

now how to solve this problem Plz Help me for that and thanks for help

sorry for bad english

by zinhell on 11 Jun 2009

Hi all ...

I'm using Mikrotik for gateway and Videocache + squid + frox in DMZ

It's work !!! file cached is unlimited traffic going to LAN

u can read in forum > support


by Kulbir Saini on 27 Jun 2009


Congrats for the setup. It would be great if you can post your configuration files or steps you followed to configure different things.

Thank You!

by Aprmicro on 6 Oct 2009

I tried the squid.ip:80 on my Mikrotik. It does not work! I mean yes you can set unlimited speed for videocache/youtube/youporn/etc.. BUT http downloads Also get unlimited speed because it also uses port 80. I tried to use a download manager and OMG! it is eating up my bandwidth!

Meybe someone have any more ideas?

by Claudio on 4 Mar 2011

Plz Help me
Maybe someone have any more ideas?
I need unlimited speed for videocache + Mikrotik.