Commit a673901c authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(proxy) add option maximum_object_size, issue https://github.com/opnsense/core/issues/787

(cherry picked from commit 731d5ab6)
parent a7e3dcfd
......@@ -128,6 +128,13 @@
<help><![CDATA[Enter the number of first-level subdirectories for the local cache (default is 256).]]></help>
<advanced>true</advanced>
</field>
<field>
<id>proxy.general.cache.local.maximum_object_size</id>
<label>Maximum object size (MB)</label>
<type>text</type>
<help><![CDATA[Set the maximum object size (default 4MB when left empty).]]></help>
<advanced>true</advanced>
</field>
</subtab>
<subtab id="proxy-general-traffic" description="Traffic Management Settings">
<field>
......
......@@ -84,6 +84,12 @@
<ValidationMessage>Specify a positive memory cache size. (number of MB's)</ValidationMessage>
<Required>Y</Required>
</cache_mem>
<maximum_object_size type="IntegerField">
<MinimumValue>1</MinimumValue>
<MaximumValue>99999</MaximumValue>
<ValidationMessage>Specify a maximum object size. (number of MB's)</ValidationMessage>
<Required>N</Required>
</maximum_object_size>
<size type="IntegerField">
<default>100</default>
<MinimumValue>1</MinimumValue>
......
......@@ -270,16 +270,19 @@ http_access allow subnets
http_access deny all
{% if helpers.exists('OPNsense.proxy.general.cache.local') %}
cache_mem {{ OPNsense.proxy.general.cache.local.cache_mem|default('256') }} MB
{% if OPNsense.proxy.general.cache.local.maximum_object_size|default('') != '' %}
maximum_object_size {{OPNsense.proxy.general.cache.local.maximum_object_size}} MB
{% if OPNsense.proxy.general.cache.local.maximum_object_size|int > 4 %}
cache_replacement_policy heap LFUDA
{% endif %}
{% endif %}
{% if OPNsense.proxy.general.cache.local.enabled == '1' %}
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs {{OPNsense.proxy.general.cache.local.directory}} {{OPNsense.proxy.general.cache.local.size}} {{OPNsense.proxy.general.cache.local.l1}} {{OPNsense.proxy.general.cache.local.l2}}
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.proxy.general.cache.local') %}
cache_mem {{ OPNsense.proxy.general.cache.local.cache_mem|default('256') }} MB
{% endif %}
# Leave coredumps in the first cache dir
coredump_dir /var/squid/cache
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment