diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml b/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml index 8af93fec5..1f038b15d 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml +++ b/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml @@ -177,6 +177,25 @@ Set the maximum object size (default 4MB when left empty). true + + proxy.general.cache.local.maximum_object_size_in_memory + + text + Set the maximum object size in memory (default 512KB when left empty). + true + + + proxy.general.cache.local.memory_cache_mode + + dropdown + + Controls which objects to keep in the memory cache (cache_mem) + always: Keep most recently fetched objects in memory (default) + disk: Only disk cache hits are kept in memory, which means an object must first be cached on disk and then hit a second time before cached in memory. + network: Only objects fetched from network is kept in memory + + true + proxy.general.cache.local.cache_linux_packages diff --git a/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml b/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml index f36604348..f8bee385e 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml +++ b/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml @@ -1,6 +1,6 @@ //OPNsense/proxy - 1.0.4 + 1.0.5 (squid) proxy settings @@ -131,6 +131,22 @@ Specify a maximum object size. (number of MB's) N + + 1 + 99999 + Specify a maximum object size in memory. (number of KB's) + N + + + always + N + Default + + Keep all most recent files (always) + Keep most recent HIT files(disk) + Keep only files fetched from network (network) + + 100 1 diff --git a/src/opnsense/service/templates/OPNsense/Proxy/squid.conf b/src/opnsense/service/templates/OPNsense/Proxy/squid.conf index a5fb79021..212523677 100644 --- a/src/opnsense/service/templates/OPNsense/Proxy/squid.conf +++ b/src/opnsense/service/templates/OPNsense/Proxy/squid.conf @@ -313,6 +313,12 @@ maximum_object_size {{OPNsense.proxy.general.cache.local.maximum_object_size}} M cache_replacement_policy heap LFUDA {% endif %} {% endif %} +{% if OPNsense.proxy.general.cache.local.maximum_object_size_in_memory|default('') != '' %} +maximum_object_size_in_memory {{OPNsense.proxy.general.cache.local.maximum_object_size_in_memory}} KB +{% endif %} +{% if OPNsense.proxy.general.cache.local.memory_cache_mode|default('always') != 'always' %} +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}} {% endif %}