Re: cache deny all

Olaf Westrik <weizen_42-Yz37vSk3/[email protected]> Wed, 20 Mar 2013 15:27:42 +0100
Newsgroups gmane.comp.security.ipcop.devel
Message-ID <[email protected]>

>> Following Todd Wiegel's report on the ipcop-user mailing list that he was
>> unable to turn off caching, I had a look at the code in the
>> makesquidconf.plscript and there is a line that should print "cache
>> deny all" if this test
>> fails:
>> if (($proxysettings{'CACHE_SIZE'}>  0) || ($proxysettings{'CACHE_MEM'}>  0))
>>
>> ie, both CACHE_SIZE and CACHE_MEM have to be 0 to turn off caching
>
> This was introduced in svn rev. #5831 [1] from Olaf.
>
>
>> But there is error checking in proxy.cgi that prevents CACHE_MEM being less
>> than 1
>>
>> So, at the moment, I think "cache deny all" is broken.
>
> Think so too.
>
>
>> What's the best way to repair? Allow a zero for CACHE_MEM? What might that
>> break?
>
> I think if it can be set to zero, there should be a check if it is>0 before
> writing "cache_mem $proxysettings{'CACHE_MEM'} MB" to squid.conf.

cache_mem does not break when set to 0 MB. So allowing 0 for CACHE_MEM 
in proxy.cgi is sufficient.

CACHE_MEM was added to be able to have (limited) caching and not bother 
with the (slow) harddisk.

>> The Admin Manual refers to turning off harddisk caching with a 0 in
>> CACHE_SIZE, but it doesn't mention CACHE_MEM, so perhaps the fix lies in
>> the makesquidconf.pl script?
>>
>> Eric
>
> I think the correct way to fix this would be to change the check in proxy.cgi so
> CACHE_MEM can be set to 0 too. If this is changed, the docu too should mention
> the CACHE_MEM in the "disable cache" section.

I'll change proxy.cgi to also allow 0 for CACHE_MEM.


Olaf

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar