mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-25 18:32:57 +02:00
squid: Add RAM-only Proxy functionality
As suggested by Oliver "giller" Fieker <oli@new-lan.de> in bug 10592 I added the functionality to use the squid as ram-only cache. Further it defines the maximum_object_size_in_memory as 2% of the in the webif defined "Memory cache size". The maximum_object_size_in_memory should have a useful size of the defined memory cache and I don't want to create another variable which muste be fulled in by the user. Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org> Suggested-by: Oliver "giller" Fieker <oli@new-lan.de> Suggested-by: Kim Wölfel <xaver4all@gmx.de> Acked-by: Michael Tremer <michael.tremer@ipfire.org> Cc: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
01bec95655
commit
53d6755451
@@ -401,8 +401,7 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'}
|
||||
$errormessage = $Lang::tr{'proxy errmsg filedescriptors'};
|
||||
goto ERROR;
|
||||
}
|
||||
if (!($proxysettings{'CACHE_MEM'} =~ /^\d+/) ||
|
||||
($proxysettings{'CACHE_MEM'} < 1))
|
||||
if (!($proxysettings{'CACHE_MEM'} =~ /^\d+/))
|
||||
{
|
||||
$errormessage = $Lang::tr{'advproxy errmsg mem cache size'};
|
||||
goto ERROR;
|
||||
@@ -3172,7 +3171,7 @@ END
|
||||
}
|
||||
}
|
||||
|
||||
if ($proxysettings{'CACHE_SIZE'} > 0)
|
||||
if (($proxysettings{'CACHE_SIZE'} > 0) || ($proxysettings{'CACHE_MEM'} > 0))
|
||||
{
|
||||
print FILE "\n";
|
||||
|
||||
@@ -3269,7 +3268,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) {
|
||||
# always 2% of CACHE_MEM defined as max object size
|
||||
print FILE "maximum_object_size_in_memory " . int($proxysettings{'CACHE_MEM'} * 1024 * 0.02) . " KB\n\n";
|
||||
} else {
|
||||
print FILE "cache deny all\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
print FILE <<END
|
||||
|
||||
Reference in New Issue
Block a user