From mboxrd@z Thu Jan  1 00:00:00 1970
From: Xaver4all <xaver4all@gmx.de>
To: development@lists.ipfire.org
Subject: [PATCH] Add RAM-only Proxy functionality - Bug Report #10592
Date: Mon, 28 Dec 2015 00:57:39 +0100
Message-ID: <56807AF3.3000109@gmx.de>
In-Reply-To: <1451172013-18852-1-git-send-email-matthias.fischer@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0903035811166258409=="
List-Id: <development.lists.ipfire.org>

--===============0903035811166258409==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Squiddoesn't use RAM only for caching, if you set cachesize for disk
usage =0 andmemory cachesize >0 in GUI.
Now if you set "cache_size"=0 and "cache_mem">0,caching won't be
disabled completely ("cache deny all").
If you want todisable caching completely you must set "cache_size"=0 and
"cache_mem"=0.
Besides this "maximum_object_size_in_memory" will be set to 512KB.

Originally reported by qiller in Bugtracker form over one year. I just
created the diff an tested this on my IP-Fire.

Especially for the announced 64 Bit version of IP-Fire, where Squid can
handel more RAM, this may be useful.

Reported-by: qiller
Signed-off-by: Kim Wölfel <xaver4all(a)gmx.de>
---
 html/cgi-bin/proxy.cgi | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi
index 6c4e2b0..164ca63 100644
--- a/html/cgi-bin/proxy.cgi
+++ b/html/cgi-bin/proxy.cgi
@@ -3173,7 +3173,7 @@ END
         }
     }
 
-    if ($proxysettings{'CACHE_SIZE'} > 0)
+    if (($proxysettings{'CACHE_SIZE'} > 0) ||
($proxysettings{'CACHE_MEM'} > 0))
     {
         print FILE "\n";
 
@@ -3270,7 +3270,12 @@ cache_dir aufs /var/log/cache
$proxysettings{'CACHE_SIZE'} $proxysettings{'L1_DI
 END
         ;
     } else {
-        print FILE "cache deny all\n\n";
+        if ($proxysettings{'CACHE_MEM'} > 0)
+        {
+            print FILE "maximum_object_size_in_memory 512 KB\n\n";
+        } else {
+            print FILE "cache deny all\n\n";
+        }
     }
 
     print FILE <<END
-- 
2.6.4.windows.1



--===============0903035811166258409==--