From 0966f6a152bea646cdd89c6012bbaeef5533ce19 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Mon, 16 Apr 2012 07:22:52 +0000 Subject: squid3 - version 2.0.3 with dynamic content options on cache tab --- config/squid-reverse/squid.inc | 81 +++++++++++++++++++++++++++++------- config/squid-reverse/squid_cache.xml | 31 ++++++++++++++ pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 4 files changed, 100 insertions(+), 16 deletions(-) diff --git a/config/squid-reverse/squid.inc b/config/squid-reverse/squid.inc index 408ecb7a..f4939201 100644 --- a/config/squid-reverse/squid.inc +++ b/config/squid-reverse/squid.inc @@ -825,13 +825,14 @@ function squid_resync_cache() { $disk_cache_size = ($settings['harddisk_cache_size'] ? $settings['harddisk_cache_size'] : 100); $level1 = ($settings['level1_subdirs'] ? $settings['level1_subdirs'] : 16); $memory_cache_size = ($settings['memory_cache_size'] ? $settings['memory_cache_size'] : 8); - $max_objsize = ($settings['maximum_object_size'] ? $settings['maximum_object_size'] : 10); + $max_objsize = ($settings['maximum_object_size'] ? $settings['maximum_object_size']." KB" : "10 KB"); $min_objsize = ($settings['minimum_object_size'] ? $settings['minimum_object_size'] : 0); $max_objsize_in_mem = ($settings['maximum_objsize_in_mem'] ? $settings['maximum_objsize_in_mem'] : 32); $cache_policy = ($settings['cache_replacement_policy'] ? $settings['cache_replacement_policy'] : 'heap LFUDA'); $memory_policy = ($settings['memory_replacement_policy'] ? $settings['memory_replacement_policy'] : 'heap GDSF'); $offline_mode = ($settings['enable_offline'] == 'on' ? 'on' : 'off'); - + $conf = ''; + if (!isset($settings['harddisk_cache_system'])) { if ($g['platform'] == "nanobsd") { $disk_cache_system = 'null'; @@ -845,17 +846,71 @@ function squid_resync_cache() { if ($disk_cache_system != "null") { $disk_cache_opts = "cache_dir {$disk_cache_system} {$cachedir} {$disk_cache_size} {$level1} 256"; } +//check dynamic content +if(empty($settings['cache_dynamic_content'])){ + $conf.='acl dynamic urlpath_regex cgi-bin \?'."\n"; + $conf.="cache deny dynamic\n"; +} +else{ + if(preg_match('/youtube/',$settings['refresh_patters'])){ + $conf.=<<Heap LRUheap LRU + + Dynamic and Update Content + listtopic + + + Cache Dynamic Content + cache_dynamic_content + enable caching of dynamic content.
+ ]]>
+ checkbox + 10 +
+ + Refresh Patters + refresh_patters + Youtube and windowsupdate
+
Notes:
+ set 'Finish transfer if less than x KB remaining' on 'traffic mgmt' squid tab to -1 when applying these patters.

+ set Maximum download size on 'traffic mgmt' squid tab to a value that fits patters your are applying.
Microsoft may need 200Mb and youtube 4GB.]]>
+ select + none + + + + + + + + + 06 +
if($_POST['harddisk_cache_size'] != $config['installedpackages']['squidcache']['config'][0]['harddisk_cache_size']) { diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 43e02cfb..a83e6a1a 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1010,7 +1010,7 @@ http://forum.pfsense.org/index.php/topic,48347.0.html http://www.squid-cache.org/ Network - 3.1.19 pkg 2.0.2 + 3.1.19 pkg 2.0.3 RC1 2.0 marcellocoutinho@gmail.com fernando@netfilter.com.br seth.mos@dds.nl mfuchs77@googlemail.com jimp@pfsense.org diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index b329b4cd..405261d9 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -118,7 +118,7 @@ http://forum.pfsense.org/index.php/topic,48347.0.html http://www.squid-cache.org/ Network - 3.1.19 pkg 2.0.2 + 3.1.19 pkg 2.0.3 Stable 2.0 fernando@netfilter.com.br seth.mos@dds.nl mfuchs77@googlemail.com jimp@pfsense.org -- cgit v1.2.3