Use the cache directive instead of no_cache for Squid 2.6
authorJamie Cameron <jcameron@webmin.com>
Thu, 28 Feb 2008 05:42:42 +0000 (05:42 +0000)
committerJamie Cameron <jcameron@webmin.com>
Thu, 28 Feb 2008 05:42:42 +0000 (05:42 +0000)
squid/CHANGELOG
squid/edit_cache.cgi
squid/save_cache.cgi

index 3415899..88d87f4 100644 (file)
@@ -23,3 +23,5 @@ Ensure that HTTP and ICP restrictions are created after ACLs in the config file.
 ---- Changes since 1.390 ----
 The httpd_accel family of directives are no longer shown when using Squid versions 2.6 and above (as they have been deprecated).
 Directives that refer to ACLs like http_access are no longer re-positioned in the configuration file unless necessary.
+---- Changes since 1.400 ----
+Use the cache directive instead of no_cache for Squid 2.6.
index 3861834..4ad2f43 100755 (executable)
@@ -125,10 +125,18 @@ if ($squid_version < 2) {
        print "</tr>\n";
        }
 
+# ACLs not to cache
 print "<tr> <td valign=top><b>$text{'ec_ncua'}</b></td> <td>\n";
 print "<table>\n";
 @acls = grep { !$acldone{$_->{'values'}->[0]}++ } &find_config("acl", $conf);
-@v = &find_config("no_cache", $conf);
+if ($squid_version >= 2.6) {
+       # 2.6+ plus uses "cache deny"
+       @v = &find_config("cache", $conf);
+       }
+else {
+       # Older versions use cache
+       @v = &find_config("no_cache", $conf);
+       }
 foreach $v (@v) {
        foreach $ncv (@{$v->{'values'}}) {
                $noca{$ncv}++;
index 059c47c..7156380 100755 (executable)
@@ -78,11 +78,12 @@ if ($squid_version < 2) {
        &save_list("cache_stoplist_pattern", undef, $conf);
        }
 @noch = split(/\0/, $in{'no_cache'});
+$nochname = $squid_version >= 2.6 ? 'cache' : 'no_cache';
 if (@noch) {
-       $nc[0] = { 'name' => 'no_cache',
+       $nc[0] = { 'name' => $nochname,
                   'values' => [ "deny", @noch ] };
        }
-&save_directive($conf, "no_cache", \@nc, "acl");
+&save_directive($conf, $nochname, \@nc, "acl");
 &save_opt_time("reference_age", $conf);
 if ($squid_version < 2) {
        &save_opt("request_size", \&check_size, $conf);