Request for Mikrotik Team, ability to cache Youtube?

I have a request for Mikrotik team if they can add ability to web-proxy to cache youtube videos like other cache servers, if yes when we can hope for it or is there any way to cache them if yes can you help us how?

what would be the use to do this? youtube has over 10 million videos on their system, and I bet RouterOS doesn’t support harddrives that could store all that :slight_smile:

Video caching should work like normal HTTP caching because users click on same popular clips.

If youtube videos are requested via normal HTTP as .flv files, then they get through the proxy, right? What is the requirement for the .flv file to remain in cache and be served from cache next time when another user requests it?

I don’t think it works that way, but we could check

There could be a variation to the HTTP protocol used but in my opinion a web proxy could be easily adapted to catch that .flv/video stream/modified HTTP in cache. And I haven’t looked into http://cachevideos.com/ how it’s done yet.

Aha I got it. Problem with video caching is dynamic URLs each time. Here’s a quote from the above site:

A1. VideoCache is squid url rewriter which caches dynamically served videos from various websites which can not be cached by using squid alone in caching mode. For more details on videocache, check the home page.

A2. When a video is requested from an identified website, videocache traps the request from squid and caches the video on the local storage on proxy server. Later, if there is a subsequent request for the same video, then the video is served from the cache in proxy server and bandwidth is saved.

To MikroTik developers: I am contacting my buddies guerilla activists right now. We are organizing protest in front of MikroTik building and we are blocking all exits until developers implement the video cache into MT Web Proxy.

I love it when people talk big on the internet.

Dear Normis ;

so why we caching the HTTP web sites ??? , who can say that our clients open the same web pages ???

we need cache if and only if a client asked for the same web page or the same song or the same video etc …
i could put two or more sata HDD each one with 250 GB and when they will be fulled i will clear them or one of them , just to be sure that users during month or more could collect their requests from the cache and not from the internet all the time.
this will save the bandwidth for real and more important requests .
hope to hear good news better than moving to squid and other program .
with best regards.

I love it when people take things seriously on the internet and get worked up over it. :slight_smile:

YOU cannot cache YOUTUBE for now.

Squid developers have some external python scripts but not yet successfull 100%.

Mikrotik is not proxy/caching server :wink:

Why would you say that? It IS a caching server.

:slight_smile:

Hi all ;
MikroTik could cache http://www.tiktube.com videos easly ,so why it is not able to cache other web site videos ?
what do you mean by MikroTik is not a cache proxy server ?
with best regards .

tiktube can be cached because it’s not youtube. it’s different.

mikrotik is primarily a router, caching is not it’s main purpose, so it doesn’t have all the features in this regard.

TikTube and Youtube are different things. Have you read squid caching of dynamic content?

Squid is a caching proxy server and been that for a long time :slight_smile:, and still cannot cache dynamic content, why do you think that MikroTik team all of a sudden can make it possibile?

Man don’t be a smartass! Videos are not dynamic content but just have some difference in the url each time they are loaded. How hard is it to see how http://www.cachevideos.com/ is doing it and do the same thing? Not hard. India and China are crawling with programmers that want to do it for 1$ per hour lol.

p.s. where is http://www.cachevideos.com/ ?

Hi all ;
yes i didn’t read anything before about squid , as i read in this forum that mikrotik changed the web proxy from squid to MikroTik web-proxy in ver 3.0
then we upgrade the systems to 3.x and start configuring it as cache servers , it working fine with me now as i have to pc’s working as cache .
each server serving max about 19 user , but i see it not practical more than this as it start slowing the supply of the TOS content with traffic .
now i start downloading debian 5 and reading how to configure it with squid 3.0 .
wish this will help me more and more to supply the cached content at the max speed and make the users happy .
with best regards .

I think you can cache in fact I am doing cache of youtube videos with the help of cache vidoes, and it saves a lot of my bandwidth. Take e look at www.cachevidoes.com

Videocache currently supports the caching of dynamically served videos from the following websites

1.Youtube Videos - youtube.com and all country specific sub-domains like in.youtube.com. This includes the youtube videos served from Google (googlevideo.com) servers.
2.Metacafe Videos - metacafe.com
3.DailyMotion Videos - dailymotion.com
4.Google Videos - video.google.com
5.Vimeo HD Videos - vimeo.com
6.Wrzuta Audio - wrzuta.pl (not videos)
7.MSN Soapbox Videos - soapbox.msn.com
8.Blip TV Videos (Including High Quality) - blip.tv
9.Break Videos (Including High Quality) - break.com
10.TV UOL (Brazil) - tvuol.uol.com.br


and some other pages.

Dear Beny ;
could you tell us how do you use this to cache videos ? , with mikrotik or what ?
this will help us alot .
what i am doing now is limiting the speed of youtube and metacafe to about 56kbps to reduce the effect of it on my bandwidth .
with best regards .

I have so:

/ip firewall layer7-protocol
add comment="" name=httpVideo regexp="http/(0\\.9|1\\.0|1\\.1)[\\x09-\\x0d ][1-5][0-9][0-9][\\x09-\\x0d -~]*(content-type: video)\r\"



/ip firewall mangle
add action=mark-packet chain=prerouting comment="httpVideo"in-interface=WAN layer7-protocol=httpVideo new-packet-mark=prio_3_in passthrough=no
add action=mark-packet chain=postrouting layer7-protocol=httpVideo new-packet-mark=prio_3_out out-interface=WAN passthrough=no



add action=mark-packet chain=prerouting comment="http download up files 0,5mb" connection-bytes=500000-0 dst-port=80 in-interface=WAN new-packet-mark=prio_7_in passthrough=no protocol=tcp
add action=mark-packet chain=postrouting connection-bytes=500000-0 new-packet-mark=prio_7_out out-interface=WAN passthrough=no protocol=tcp src-port=80



add action=mark-packet chain=prerouting comment="80 http => www, under 0.5mb, Normal www" dst-port=80 in-interface=WAN new-packet-mark=prio_1_in passthrough=no protocol=tcp
add action=mark-packet chain=postrouting new-packet-mark=prio_1_out out-interface=WAN passthrough=no protocol=tcp src-port=80

But Layer7 “httpVideo” no mangle traffic video, wyh?
Do I have something wrong?

Hi ;
here are what i am doing to limit the speed of youtube and metacafe .
first don’t try to block these web sites as you are going to block google as well .
and for that i made browsing these web sites faster than the watching movies .
for browsing i am using 80kbps and for watching i am using 56kbps , you could use the speed suit you .
first in mangle to mark the upload of your local network :

/ip firewall mangle
add action=mark-connection chain=prerouting comment="marking total upload" disabled=no in-interface=bridge1 new-connection-mark="upload" passthrough=\
    yes src-address=192.168.x.0/24

and then to mark the upload to youtube , google and metacafe :

/ip firewall mangle
add action=mark-connection chain=prerouting comment="download youtube & metacafe movies" connection-bytes=200000-0 connection-mark="upload" disabled=no \
    dst-address=208.65.0.0/16 dst-port=80 in-interface=bridge1 new-connection-mark=youtube passthrough=yes protocol=tcp src-address=192.168.x.0/24 \
    src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=200000-0 connection-mark="upload" disabled=no dst-address=208.117.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtube passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=200000-0 connection-mark="upload" disabled=no dst-address=64.15.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtube passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65353
add action=mark-connection chain=prerouting comment="" connection-bytes=200000-0 connection-mark="upload" disabled=no dst-address=74.125.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtube passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=200000-0 connection-mark="upload" disabled=no dst-address=213.155.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtube passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=200000-0 connection-mark="upload" disabled=no dst-address=213.155.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtube passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535
add action=mark-connection chain=prerouting comment="browse youtube & metacafe" connection-bytes=0-200000 connection-mark="upload" disabled=no \
    dst-address=208.65.0.0/16 dst-port=80 in-interface=bridge1 new-connection-mark=youtubea passthrough=yes protocol=tcp src-address=192.168.x.0/24 \
    src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=0-200000 connection-mark="upload" disabled=no dst-address=208.117.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtubea passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=0-200000 connection-mark="upload" disabled=no dst-address=64.15.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtubea passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=0-200000 connection-mark="upload" disabled=no dst-address=74.125.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtubea passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=0-200000 connection-mark="upload" disabled=no dst-address=213.155.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtubea passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535
add action=mark-connection chain=prerouting comment="" connection-bytes=0-200000 connection-mark="upload" disabled=no dst-address=213.155.0.0/16 \
    dst-port=80 in-interface=bridge1 new-connection-mark=youtubea passthrough=yes protocol=tcp src-address=192.168.x.0/24 src-port=1024-65535

then to mark the coming traffic of these sites :

/ip firewall mangle
add action=mark-packet chain=postrouting comment="youtube download traffic" connection-mark=youtube disabled=no dst-address=192.168.x.0/24 new-packet-mark=\
    youtube out-interface=bridge1 passthrough=no
add action=mark-packet chain=postrouting comment="youtube browsing traffic" connection-mark=youtubea disabled=no dst-address=192.168.x.0/24 new-packet-mark=youtubea out-interface=\
    bridge1 passthrough=no

in my case i am using bridge1 to my local network , so you should change it to be the ether of your local network with the ip’s of the local network .
now you have the packets of the traffic coming from these web site , so you could use queue tree to limit the speed of it .

with best regards .