Now here’s my question:
Let’s say I want to get a file from download.com for 10MB, and this file then is then stored (or “cached”, is that the word?) in the mikrotik proxy. If then another client want to get the same file, it would get the file from the proxy (well, at least I think it would), but at the same limited speed (512k).
Is there ANY way to bypass this queue rule for data that’s already stored in the proxy? So, maybe use 10M/100M for cached data, and use limited speed for stuff that’s not cached… Is this possible at all?
I’m thinking of using mangle on traffic going to 192.168.1.1 (that’s the router’s address) port 80, 3128, and 8080, and then creating a separate simple queue rule for each client for 10M/10M. But then wouldn’t that render the previous rules useless, since ALL traffic going to those ports (whether it’s for cached or uncached data) would be using the new rule?
Tried everything you suggested (dscp, mangle, and the new queue), then I download 2 files that I know is in the cache-content. Can’t seem to bypass the existing queue… It’s still in effect.
Thinking about it, if I remember correctly dynamic simple queues created by logging into a Hotspot always get inserted at the top so your rule wouldn’t hit since it moves down the list every time someone logs in. Maybe try deleting the simple queue hitting on the packet mark and use this one instead:
Deactivated the simple queue proposed by skillful, changed the max-limit to 64k/64k, activated the queue tree rule, and download a 4MB file that is in cache-content. I got between 4kbps to 7kbps, which is within the 64k limit, and never faster than that.
Your mangle rule is currently disabled, since it doesn’t work when I tried it…
/ip fir man pr without-paging
Flags: X - disabled, I - invalid, D - dynamic
0 X ;;; CACHE HIT
chain=output action=mark-packet new-packet-mark=cache-packets
passthrough=no dscp=4
You want -all- of the simple queues? I have like a hundred of em… I’ll just pasted the first 5 or something, yeah?
Oh, I have one more question… When I turned off/rebooted the router, are ALL cached data deleted? I thought it wouldn’t be deleted, since it’s stored on the hard drive. But whenever I checked the proxy status, the HD usage is always below 1G, while my clients downloaded quite a bunch of items… I expect it to be somewhere around 2-4 G… Any ideas?
why don’t you try to use external proxy instead of internal proxy from Mikrotik ?
when i use ROS v.2xx it’s internal proxy work great… but after using v.3.xx i prefer to use squid on external proxy… work better for me especialy if you want to mark “X-cache: HIT”
I -am- planning to use squid as an external proxy, but am currently confused about the positioning of the proxy. You see, I have not set up my clients to use any proxy, and set up mikrotik as a transparent proxy that listens on port 80, 3128, and 8080. I also use the mikrotik proxy as a web filter, blocking/allowing only certain sites that I set.
Here’s where it gets confusing for me:
Let’s say my local net is 192.168.1.0/24. I installed squid on a windows machine (I’m still learning to use FreeBSD, will migrate squid to that once I’m more familiar with it) with the IP 192.168.1.252. Should squid act just like another client (just one ethernet cable plugged in to a hub), or as a bridge (2 ethernet cards & 2 cables)? If it’s a bridge, should I put it between the router and the client, or between the ISP and the router? I’m more inclined to go with the 1 ethernet card answer, but I’m not quite sure.
Performance-wise, would it be better just to use squid as the only proxy (which means I have to input the squid machine’s IP and port to ALL my clients gulp)? Or would it be better to use it as a parent proxy with the current mikrotik proxy as the child proxy?
Any other caveats that I must know with regards to implementing an external proxy?
have you try to enable “always from cache” on web-proxy ?
and about squid you can put it as a bridge or same level with Mikrotik or your local…
for your multiple port, you can simply dst-nat them going to squid ip:port and make your squid transparent or you can use web-proxy to forward your proxy acces to squid as parent proxy, but this is not recomended coz you can’t cache https on MT cmiiw
and also using squidNT is not recomended