I guess I made it working.. just need to get a good php script that can also cache youtube videos. Now what firewall rule i can use to bypass user's simple queue if the transmitted file already existed in the cache and was downloaded from the cache server to the user?
thanks,
You can cache youtube like content via using 3rd party PAID Addon for SQUID name
VIDEO CACHE .
I will not recommend you to Cache Youtube , it's not worth it and you can't actually cache even 1% of
YOUTUBE, imagine how much space you will be needing , grrrrrrrr :p,
Also there are very slight chances that user will HIT the same video because of CDN.
To bypass rate limit for cached content, Using Squid with ZPH, and Mikotik Ver above 3+ , Use the following.
Add these Lines in SQUID.CONF
#==============
#ZPH
#=======================
tcp_outgoing_tos 0x30 lanuser
zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136
#[lanuser is ACL for local network, modify at as per your network]
Make sure squid is marking cache content, you can do it via TCPDUMP command. i.e
# tcpdump -vni eth0 | grep ‘tos 0×30′
(eht0 = LAN connected interface)
At Mikrotik, create one mangle rule, which will marks cache contents coming from SQUID,
Second , QUEUE tree, which will enable cache content to deliver cache content to user at LAN speed.
/ip firewall mangle add action=mark-packet chain=prerouting disabled=no dscp=12 new-packet-mark=proxy-hit passthrough=no
/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=pmark packet-mark=proxy-hit parent=global-out priority=8 queue=default
Or Read more at:
http://aacable.wordpress.com/2011/07/21 ... t-traffic/