From bd12f5dcc331f536da590ea1feb457a75572cb4e Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 7 Jan 2016 21:55:43 +0100 Subject: [PATCH] (proxy) add configurable cache_mem, closes https://github.com/opnsense/core/issues/417 --- .../mvc/app/controllers/OPNsense/Proxy/forms/main.xml | 7 +++++++ src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml | 6 ++++++ src/opnsense/service/templates/OPNsense/Proxy/squid.conf | 2 ++ 3 files changed, 15 insertions(+) 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 29a8973b4..d86522c02 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml +++ b/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml @@ -92,6 +92,13 @@ + + proxy.general.cache.local.cache_mem + + text + + true + proxy.general.cache.local.enabled diff --git a/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml b/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml index 5b0f414a1..48514c338 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml +++ b/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml @@ -78,6 +78,12 @@ /var/squid/cache Y + + 256 + 1 + Specify a positive memory cache size. (number of MB's) + Y + 100 1 diff --git a/src/opnsense/service/templates/OPNsense/Proxy/squid.conf b/src/opnsense/service/templates/OPNsense/Proxy/squid.conf index 561a93999..3bbb87be9 100644 --- a/src/opnsense/service/templates/OPNsense/Proxy/squid.conf +++ b/src/opnsense/service/templates/OPNsense/Proxy/squid.conf @@ -276,6 +276,8 @@ cache_dir ufs {{OPNsense.proxy.general.cache.local.directory}} {{OPNsense.proxy. {% endif %} {% endif %} +cache_mem {{ OPNsense.proxy.general.cache.local.cache_mem|default('256') }} MB + # Leave coredumps in the first cache dir coredump_dir /var/squid/cache