MT Proxy cache not working

I am pulling my hair out here.. Why cant I get proxy cache to work.
I have set the usual rules inc port 8080, cache on disk (yes), enabled etc etc

I have tried just about every configuration posted, and I have to say that the config doesnt appear that hard.

I am using transparent, so I have a redirect in the FW and yes the redirects increase consistantly.

I can even, block sites and redirect them to my own web site.


Under status tab, there are:

NO Hits
No Hits sent to clients
No cache used

requests 344,total ram used 909kb,received from servers 2512 kb,sent to clients 2510kb.

And under general tab No cache contents.

I do not want to use squid, well actually I do, but it is CLI driven and I dont have the patience to learn all the ever changing CLI options of Linux… I want a simple sollution that is CGI.

I have tried using the page http://www.lagado.com/tools/cache-test to do my cache tests, and whilst it reports taht I have a functioning Proxy, the cache facility confirms that I have no hits.

IS it because that I am using the MT RBoard test scenario deep inside my routed network and behind a Natted gateway many hops upstream.. I was reluctant to actually test it out on my real gateway router, I was kind of hoping to prove to myself whether it would work effectively, before installing it in the “real gateway”

Please post the result of /ip proxy export compact

[admin@MikroTik] > ip pro
[admin@MikroTik] /ip proxy> export compact

jan/02/1970 00:11:27 by RouterOS 6.0rc1

software id = T2IQ-HXTA

/ip proxy
set enabled=yes
/ip proxy cache
add dst-port=80 src-address=192.168.0.0/24
add action=deny
[admin@MikroTik] /ip proxy>

/ip firewall nat
add action=redirect chain=dstnat dst-address-type=!local dst-port=80 protocol=
tcp src-address=192.168.0.0/24 to-ports=8080
add action=masquerade chain=srcnat
[admin@MikroTik] /ip firewall nat>

You have no cache. Set the cache size with max-cache-size=xxx (in KB). Default is max-cache-size=none, and the proxy doesnt cache.

Also, setting always-from-cache=yes can help to avoid not hitting cache because your browser using the refresh header inside the get method. In this case proxy would not respond, cause its a refresh.

Yes I have cache size, for some reason cache size does not show up with “export compact” which kind of defeats the whole export compact thing!

But I will try your suggestion regarding the “always from cache”, but I have to say that its not shown in any example configurations that I have seen, or the wiki..

But never say never, so I’ll keep you posted.

[admin@MikroTik] /ip proxy> pr
enabled: yes
src-address: 0.0.0.0
port: 8080
parent-proxy: 0.0.0.0
parent-proxy-port: 0
cache-administrator: webmaster
max-cache-size: 8000KiB
cache-on-disk: yes
max-client-connections: 600
max-server-connections: 600
max-fresh-time: 3d
serialize-connections: no
always-from-cache: no
cache-hit-dscp: 4
cache-drive: system

Sorry to disappoint, its still the same, NO hits.. I was doing the page test again with Lagado.com and was careful to clear browser cache before refreshing page.

Anymore suggestions, Anyone!

Here is our company proxy. Its quite aggresive as you can see (30d cache and always-from-cache=yes)

This is on x86 with 5.18
proxy.jpg

can you confirm that the site www.lagado.com and follow the link to tools/cache, does actually provide cached results with you.

Dont want to be chasing a red herring.

Also mad memory unlimited, like your setup… But still the same.

I am not currently at work, so if you dont mind, I will check tommorow.

I would also suggest you test it on 5.20, since you are testing on the v6 rc, which might have a problem :slight_smile:

ok, no problem.. I did try 5.20 as well.

ok, got it sorted.

Not really mentioned anywhere that I could see, but it was a necessity to have at least 1 DNS server listed in the

IP>DNS tab

Hello,
seems like the topic is dead, however I would like to ask if you’ve found any other reasons because of which the cache is not working.

I’ve got RouterBoard 951G-2HnD. The DNS soultion didn’t work for me. The cache is still on 0kB.

PS:Sorry for doubled post below, but it looked like the post was lost and I wrote another one.

Hello,
it doesn’t seem like the solution. My config is preety much the same (proxy as below, setup as transparent). I’ve got the same problem and DNS didn’t work for me.

Anyone has other suggestions?

PS: /ip proxy export compact

[admin@MikroTik] /ip proxy> export compact 
# nov/26/2013 21:40:22 by RouterOS 6.6
# software id = VIKL-D30F
#
/ip proxy
set always-from-cache=yes cache-administrator=me@mail.com cache-on-disk=yes enabled=yes max-cache-size=102401KiB parent-proxy=0.0.0.0