OPNsense Forum

English Forums => Development and Code Review => Topic started by: tillsense on December 28, 2016, 07:46:02 am

Title: [SOLVED] Squid Page does not allow 0 Memory Cache
Post by: tillsense on December 28, 2016, 07:46:02 am
Hi,

the configuration page of squid (cache settings) does not allow 0 to disable memory cache size in megabytes.

Squid.conf
Code: [Select]
cache deny all
cache_mem 0

Reference: http://www.squid-cache.org/Advisories/SQUID-2016_11.txt

cheers till

--------------------------------------------------------------------
OPNsense 17.1.b_66-amd64
FreeBSD 11.0-RELEASE-p5
OpenSSL 1.0.2j 26 Sep 2016
Title: Re: Squid Page does not allow 0 Memory Cache
Post by: tillsense on January 06, 2017, 06:35:11 pm
config screen:
Title: Re: Squid Page does not allow 0 Memory Cache
Post by: franco on January 06, 2017, 06:41:02 pm
Nice catch, how about instead writing these two lines by default when "Enable local cache" is disabled?

FWIW, 16.7.13 shipped the fixed Squid 3.5.23.
Title: Re: Squid Page does not allow 0 Memory Cache
Post by: tillsense on January 06, 2017, 06:52:56 pm
hi franco,

yes i think that would be a good preset!

cheers till

-------------------------------------
OPNsense 17.1.b_94-amd64
FreeBSD 11.0-RELEASE-p6
OpenSSL 1.0.2j 26 Sep 2016
Title: Re: Squid Page does not allow 0 Memory Cache
Post by: franco on January 09, 2017, 09:10:42 am
Hi Till,

This should do the trick: https://github.com/opnsense/core/commit/d3e27cface8


Cheers,
Franco
Title: Re: [SOLVED] Squid Page does not allow 0 Memory Cache
Post by: tillsense on January 09, 2017, 09:28:21 pm
Hi Franco,

i looked at this and i think this should be 0. For 0 is a good config the two lines to write off but 1 is 1 MB for cache_mem. Or maybe better an checkbox? The used full help is also misleading here.


cheers till

-------------------------------------------
OPNsense 17.1.b_103-amd64
FreeBSD 11.0-RELEASE-p6
OpenSSL 1.0.2j 26 Sep 2016

Title: Re: [SOLVED] Squid Page does not allow 0 Memory Cache
Post by: franco on January 14, 2017, 09:55:59 am
Hi Till,

Not sure what you mean. I had to go back and implement your idea anyway, the cache disable/enable is a bit incoherent for us:

https://github.com/opnsense/core/commit/cf48dbb970


Cheers,
Franco
Title: Re: [SOLVED] Squid Page does not allow 0 Memory Cache
Post by: tillsense on January 19, 2017, 06:28:11 pm
Hi Franco,

in post 5 i had not seen your second commit yet ;) as far as the checkbox is concerned it could be similar to the activation of the local cache by checkbox.

But the implementation of https://github.com/opnsense/core/pull/1328 (https://github.com/opnsense/core/pull/1328) should have prio for backend that's the right way :)



cheers till

-------------------------------------------
OPNsense 17.1.r-amd64
FreeBSD 11.0-RELEASE-p7
OpenSSL 1.0.2j 26 Sep 2016