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 ++++++++++++++ 2 files changed, 98 insertions(+), 14 deletions(-) (limited to 'config/squid-reverse') 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']) { -- cgit v1.2.3