www/squid: change cache_dir from ufs to rock (#4487)

This commit is contained in:
Andy Binder
2025-03-11 15:44:42 +01:00
committed by GitHub
parent 897ad8a807
commit 11bb18d97d
3 changed files with 29 additions and 19 deletions
@@ -148,17 +148,24 @@
<advanced>true</advanced>
</field>
<field>
<id>proxy.general.cache.local.l1</id>
<label>Number of first-level subdirectories</label>
<id>proxy.general.cache.local.swap_timeout</id>
<label>Disk I/O Timeout for Swap Operations (msec)</label>
<type>text</type>
<help>Enter the number of first-level subdirectories for the local cache (default is 16).</help>
<help>Prevents Squid from reading/writing to disk if the operation exceeds the specified timelimit in milliseconds (default 0 = disable when left empty).</help>
<advanced>true</advanced>
</field>
<field>
<id>proxy.general.cache.local.l2</id>
<label>Number of second-level subdirectories</label>
<id>proxy.general.cache.local.max_swap_rate</id>
<label>Disk I/O Timeout for Swap Operations (swaps/sec)</label>
<type>text</type>
<help>Enter the number of second-level subdirectories for the local cache (default is 256).</help>
<help>Limits disk access by setting a maximum I/O rate in swaps per second (default 0 = disable when left empty).</help>
<advanced>true</advanced>
</field>
<field>
<id>proxy.general.cache.local.slot_size</id>
<label>Cache Database-Record Size (bytes)</label>
<type>text</type>
<help>Defines the size of a database record used to store cached responses. Value should be a multiple of the OS I/O page size (default 16384 when left empty).</help>
<advanced>true</advanced>
</field>
<field>
@@ -124,18 +124,21 @@
<ValidationMessage>Specify a positive cache size. (number of MB's)</ValidationMessage>
<Required>Y</Required>
</size>
<l1 type="IntegerField">
<Default>16</Default>
<MinimumValue>1</MinimumValue>
<ValidationMessage>Specify a positive number of first-level subdirectories.</ValidationMessage>
<Required>Y</Required>
</l1>
<l2 type="IntegerField">
<Default>256</Default>
<MinimumValue>1</MinimumValue>
<ValidationMessage>Specify a positive number of second-level subdirectories.</ValidationMessage>
<Required>Y</Required>
</l2>
<swap_timeout type="IntegerField">
<MinimumValue>0</MinimumValue>
<ValidationMessage>Specify a valid swap-timeout.</ValidationMessage>
<Required>N</Required>
</swap_timeout>
<max_swap_rate type="IntegerField">
<MinimumValue>0</MinimumValue>
<ValidationMessage>Specify a valid swap-rate.</ValidationMessage>
<Required>N</Required>
</max_swap_rate>
<slot_size type="IntegerField">
<MinimumValue>4096</MinimumValue>
<ValidationMessage>Specify a multiple of operating system I/O page size.</ValidationMessage>
<Required>N</Required>
</slot_size>
<cache_linux_packages type="BooleanField">
<Default>0</Default>
<Required>Y</Required>
@@ -320,7 +320,7 @@ maximum_object_size_in_memory {{OPNsense.proxy.general.cache.local.maximum_objec
memory_cache_mode {{OPNsense.proxy.general.cache.local.memory_cache_mode}}
{% endif %}
{% if OPNsense.proxy.general.cache.local.enabled == '1' %}
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}}
cache_dir rock {{OPNsense.proxy.general.cache.local.directory}} {{OPNsense.proxy.general.cache.local.size}}{% if not helpers.empty('OPNsense.proxy.general.cache.local.swap_timeout') %} swap-timeout={{OPNsense.proxy.general.cache.local.swap_timeout}}{% endif %}{% if not helpers.empty('OPNsense.proxy.general.cache.local.max_swap_rate') %} max-swap-rate={{OPNsense.proxy.general.cache.local.max_swap_rate}}{% endif %}{% if not helpers.empty('OPNsense.proxy.general.cache.local.slot_size') %} slot-size={{OPNsense.proxy.general.cache.local.slot_size}}{% endif %}
{% endif %}
{% endif %}
{% endif %}