diff options
author | doktornotor <notordoktor@gmail.com> | 2015-09-25 13:58:34 +0200 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-09-25 13:58:34 +0200 |
commit | 0df9bbb4d75adc5186b091be94573e4002024d3f (patch) | |
tree | 6278d533fbf1c4a4b0d7762fc584077f74c2c2fe | |
parent | f20c88c7f62294b2da432eefdb8cb3a2437d0e3d (diff) | |
download | pfsense-packages-0df9bbb4d75adc5186b091be94573e4002024d3f.tar.gz pfsense-packages-0df9bbb4d75adc5186b091be94573e4002024d3f.tar.bz2 pfsense-packages-0df9bbb4d75adc5186b091be94573e4002024d3f.zip |
squid3 - code style fixes, improve descriptions, sanitize defaults
-rwxr-xr-x | config/squid3/34/squid_cache.xml | 292 |
1 files changed, 197 insertions, 95 deletions
diff --git a/config/squid3/34/squid_cache.xml b/config/squid3/34/squid_cache.xml index 3b2cd406..6785fbb7 100755 --- a/config/squid3/34/squid_cache.xml +++ b/config/squid3/34/squid_cache.xml @@ -2,56 +2,51 @@ <!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ + <copyright> +<![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - authng.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2007 to whom it may belong - Copyright (C) 2012-2014 Marcello Coutinho - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>. - All rights reserved. - */ -/* ========================================================================== */ + squid_cache.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2012-2014 Marcello Coutinho + Copyright (C) 2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 1. Redistributions of source code MUST retain the above copyright notice, - this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - 2. Redistributions in binary form MUST reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ -/* ========================================================================== */ - ]]> - </copyright> - <description>Describe your package here</description> - <requirements>Describe your package requirements here</requirements> - <faq>Currently there are no FAQ items provided.</faq> + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>squidcache</name> - <version>none</version> - <title>Proxy server: Cache management</title> + <version>0.3.5</version> + <title>Proxy Server: Cache management</title> <include_file>/usr/local/pkg/squid.inc</include_file> <tabs> -<tab> + <tab> <text>General</text> <url>/pkg_edit.php?xml=squid.xml&id=0</url> </tab> @@ -85,7 +80,7 @@ <url>/pkg.php?xml=squid_users.xml</url> </tab> <tab> - <text>Real time</text> + <text>Real Time</text> <url>/squid_monitor.php</url> </tab> <tab> @@ -99,78 +94,120 @@ <type>listtopic</type> </field> <field> - <fielddescr>Cache replacement policy</fielddescr> + <fielddescr>Cache Replacement Policy</fielddescr> <fieldname>cache_replacement_policy</fieldname> - <description>The cache replacement policy decides which objects will remain in cache and which objects are replaced to create space for the new objects. The default policy for cache replacement is LFUDA. Please see the type descriptions specified in the memory replacement policy for additional detail.</description> + <description> + <![CDATA[ + The cache replacement policy decides which objects will remain in cache and which objects are replaced to create space for the new objects.<br/><br/> + <strong>Heap LFUDA:</strong> Keeps popular objects in cache regardless of their size and thus optimizes byte hit rate at the expense of hit rate.<br/> + <strong>Heap GDSF:</strong> Optimizes object-hit rate by keeping smaller, popular objects in cache.<br/> + <strong>Heap LRU:</strong> Works like LRU, but uses a heap instead.<br/> + <strong>LRU:</strong> Keeps recently referenced objects (i.e., replaces the object that has not been accessed for the longest time).<br/> + Please see <a href="http://www.squid-cache.org/Doc/config/cache_replacement_policy/">cache_replacement_policy documentation</a> for additional details.<br/><br/> + Default: heap LFUDA + ]]> + </description> <type>select</type> <default_value>heap LFUDA</default_value> <options> - <option><name>LRU</name><value>lru</value></option> <option><name>Heap LFUDA</name><value>heap LFUDA</value></option> <option><name>Heap GDSF</name><value>heap GDSF</value></option> <option><name>Heap LRU</name><value>heap LRU</value></option> + <option><name>LRU</name><value>lru</value></option> </options> </field> <field> - <fielddescr>Low-water-mark in %</fielddescr> + <fielddescr>Low-Water Mark in %</fielddescr> <fieldname>cache_swap_low</fieldname> - <description>Cache replacement begins when the swap usage is above the low-low-water mark and attempts to maintain utilisation near the low-water-mark.</description> + <description> + <![CDATA[ + The low-water mark for AUFS/UFS/diskd cache object eviction by the cache_replacement_policy algorithm.<br/> + Cache replacement begins when the swap usage is above this low-water mark and attempts to maintain utilisation near the low-water mark.<br/> + Please see <a href="http://www.squid-cache.org/Doc/config/cache_swap_low/">cache_swap_low documentation</a> for additional details.<br/> + ]]> + </description> <type>input</type> <size>5</size> <default_value>90</default_value> </field> <field> - <fielddescr>High-water-mark in %</fielddescr> + <fielddescr>High-Water Mark in %</fielddescr> <fieldname>cache_swap_high</fieldname> - <description>As swap utilisation gets close to the high-water-mark object eviction becomes more aggressive.</description> + <description> + <![CDATA[ + The high-water mark for AUFS/UFS/diskd cache object eviction by the cache_replacement_policy algorithm.<br/> + As swap utilization increases towards this high-water mark, object eviction becomes more agressive.<br/> + Please see <a href="http://www.squid-cache.org/Doc/config/cache_swap_high/">cache_swap_high documentation</a> for additional details.<br/> + ]]> + </description> <type>input</type> <size>5</size> <default_value>95</default_value> </field> <field> - <fielddescr>Do not cache</fielddescr> + <fielddescr>Do Not Cache</fielddescr> <fieldname>donotcache</fieldname> - <description>Enter each domain or IP address on a new line that should never be cached.</description> + <description> + <![CDATA[ + Enter domain(s) and/or IP address(es) that should never be cached.<br/> + <strong>Note: Put each entry on a separate line.</strong> + ]]> + </description> <type>textarea</type> <cols>50</cols> <rows>5</rows> <encoding>base64</encoding> </field> <field> - <fielddescr>Enable offline mode</fielddescr> + <fielddescr>Enable Offline Mode</fielddescr> <fieldname>enable_offline</fieldname> - <description>Enable this option and the proxy server will never try to validate cached objects. The offline mode gives access to more cached information than the proposed feature would allow (stale cached versions, where the origin server should have been contacted).</description> + <description> + <![CDATA[ + Enable this option and the proxy server will never try to validate cached objects.<br/> + Offline mode gives access to more cached information than normally allowed (e.g., expired cached versions where the origin server should have been contacted otherwise). + ]]> + </description> <type>checkbox</type> <required/> </field> <field> - <fielddescr>External Cache-Managers</fielddescr> + <fielddescr>External Cache Managers</fielddescr> <fieldname>ext_cachemanager</fieldname> - <description>Enter the IPs for the external Cache Managers to be allowed here, separated by semi-colons (;).</description> + <description> + <![CDATA[ + Enter the IPs for the external <a href="http://wiki.squid-cache.org/Features/CacheManager">Cache Managers</a> to be granted access to this proxy. + <strong>Note: Separate entries by semi-colons (;)</strong> + ]]> + </description> <type>input</type> <size>60</size> </field> <field> - <name>Squid Hard disk cacheSettings</name> + <name>Squid Hard Disk Cache Settings</name> <type>listtopic</type> </field> <field> - <fielddescr>Hard disk cache size</fielddescr> + <fielddescr>Hard Disk Cache Size</fielddescr> <fieldname>harddisk_cache_size</fieldname> - <description>This is the amount of disk space (in megabytes) to use for cached objects.</description> + <description>Amount of disk space (in megabytes) to use for cached objects.</description> <type>input</type> <required/> <size>10</size> <default_value>100</default_value> </field> <field> - <fielddescr>Hard disk cache system</fielddescr> + <fielddescr>Hard Disk Cache System</fielddescr> <fieldname>harddisk_cache_system</fieldname> - <description><![CDATA[This specifies the kind of storage system to use. - <br><br><b>ufs</b> is the old well-known Squid storage format that has always been there. - <br><br><b>aufs</b> uses POSIX-threads to avoid blocking the main Squid process on disk-I/O. (Formerly known as async-io.) - <br><br><b>diskd</b> uses a separate process to avoid blocking the main Squid process on disk-I/O.<br>To use <b>ipcs</b> and <b>ipcrm</b> on squid, Download livefs.iso from ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/8.3/ mount it and copy <b>/usr/bin/ipcs</b> and <b>/usr/bin/ipcrm</b> to your system and set them as executables. - <br><br><b>null</b> Does not use any storage. Ideal for Embedded/NanoBSD.]]></description> + <description> + <![CDATA[ + This specifies the kind of storage system to use.<br/><br/> + <strong>ufs</strong> - the old well-known Squid storage format that has always been there.<br/> + <strong>aufs</strong> - uses POSIX threads to avoid blocking the main Squid process on disk I/O. (Formerly known as async-io.)<br/> + <strong>diskd</strong> - uses a separate process to avoid blocking the main Squid process on disk I/O.<br/> + <strong>null</strong> - does not use any storage. Ideal for Embedded/NanoBSD.<br/><br/> + Please see <a href="http://www.squid-cache.org/Doc/config/cache_dir/">cache_dir documentation</a> for additional details. + ]]> + </description> <type>select</type> <default_value>ufs</default_value> <options> @@ -181,16 +218,25 @@ </options> </field> <field> - <fielddescr>Clear cache on log rotate</fielddescr> + <fielddescr>Clear Cache on Log Rotate</fielddescr> <fieldname>clear_cache</fieldname> - <description><![CDATA[If set, Squid will clear cache and swap.state on every log rotate.<br> - This action will be executed automatically if the swap.state file is taking up more than 75% disk space,or the drive is 90%]]></description> + <description> + <![CDATA[ + If set, Squid will clear cache and swap.state every time the log is rotated.<br/> + Note: This action will be executed automatically if the swap.state file is taking up more than 75% of available space, or the filesystem is 90% full. + ]]> + </description> <type>checkbox</type> </field> <field> - <fielddescr>Level 1 subdirectories</fielddescr> + <fielddescr>Level 1 Directories</fielddescr> <fieldname>level1_subdirs</fieldname> - <description>Each level-1 directory contains 256 subdirectories, so a value of 256 level-1 directories will use a total of 65536 directories for the hard disk cache. This will significantly slow down the startup process of the proxy service, but can speed up the caching under certain conditions.</description> + <description> + <![CDATA[ + Each level-1 directory contains 256 subdirectories, so a value of 256 level-1 directories will use a total of 65536 directories for the hard disk cache.<br/> + This will <strong>significantly</strong> slow down the startup process of the proxy service, but can speed up the caching under certain conditions. + ]]> + </description> <type>select</type> <default_value>16</default_value> <options> @@ -204,27 +250,44 @@ </options> </field> <field> - <fielddescr>Hard disk cache location</fielddescr> + <fielddescr>Hard Disk Cache Location</fielddescr> <fieldname>harddisk_cache_location</fieldname> - <description>This is the directory where the cache will be stored. (note: do not end with a /). If you change this location, squid needs to make a new cache, this could take a while</description> + <description> + <![CDATA[ + This is the directory where the cache will be stored. If you change this location, Squid needs to make a new cache, this could take a while.<br/> + Default: /var/squid/cache<br/> + <strong>Note: Do NOT include the trailing / when setting a custom location.</strong> + ]]> + </description> <type>input</type> <size>60</size> <required/> <default_value>/var/squid/cache</default_value> </field> <field> - <fielddescr>Minimum object size</fielddescr> + <fielddescr>Minimum Object Size</fielddescr> <fieldname>minimum_object_size</fieldname> - <description>Objects smaller than the size specified (in kilobytes) will not be saved on disk. The default value is 0, meaning there is no minimum.</description> + <description> + <![CDATA[ + Objects smaller than the size specified (in kilobytes) will not be saved on disk.<br/> + Default: 0 (meaning there is no minimum) + ]]> + </description> <type>input</type> <required /> <size>10</size> <default_value>0</default_value> </field> <field> - <fielddescr>Maximum object size</fielddescr> + <fielddescr>Maximum Object Size</fielddescr> <fieldname>maximum_object_size</fieldname> - <description>Objects larger than the size specified (in kilobytes) will not be saved on disk. If you wish to increase speed more than you want to save bandwidth, this should be set to a low value.</description> + <description> + <![CDATA[ + Objects larger than the size specified (in megabytes) will not be saved on disk.<br/> + Hint: If increased speed is more important than saving bandwidth, this should be set to a low value.<br/> + Default: 4 (MB) + ]]> + </description> <type>input</type> <required/> <size>10</size> @@ -235,34 +298,56 @@ <type>listtopic</type> </field> <field> - <fielddescr>Memory cache size</fielddescr> + <fielddescr>Memory Cache Size</fielddescr> <fieldname>memory_cache_size</fieldname> - <description>This is the amount of physical RAM (in megabytes) to be used for negative cache and in-transit objects. This value should not exceed more than 50% of the installed RAM. The minimum value is 1MB.</description> + <description> + <![CDATA[ + Specifies the ideal amount of physical RAM (in megabytes) to be used for In-Transit objects, Hot Objects and Negative-Cached objects.<br/> + Please see <a href="http://www.squid-cache.org/Doc/config/cache_mem/">cache_mem documentation</a> for additional details.<br/> + This value should not exceed 50% of the installed RAM. The minimum value is 1MB.<br/><br/> + Default: 64 (MB) + ]]> + </description> <type>input</type> <size>10</size> <required/> - <default_value>8</default_value> + <default_value>64</default_value> </field> <field> - <fielddescr>Maximum object size in RAM</fielddescr> + <fielddescr>Maximum Object Size in RAM</fielddescr> <fieldname>maximum_objsize_in_mem</fieldname> - <description>Objects smaller than the size specified (in kilobytes) will be saved in RAM. Default is 32.</description> + <description> + <![CDATA[ + Objects greater than this size (in kilobytes) will not be attempted to kept in the memory cache.<br/> + Default: 256 (KB) + ]]> + </description> <type>input</type> <size>10</size> <required/> - <default_value>32</default_value> + <default_value>256</default_value> </field> <field> - <fielddescr>Memory replacement policy</fielddescr> + <fielddescr>Memory Replacement Policy</fielddescr> <fieldname>memory_replacement_policy</fieldname> - <description>The memory replacement policy determines which objects are purged from memory when space is needed. The default policy for memory replacement is GDSF. <p> <b> LRU: Last Recently Used Policy </b> - The LRU policies keep recently referenced objects. i.e., it replaces the object that has not been accessed for the longest time. <p> <b> Heap GDSF: Greedy-Dual Size Frequency </b> - The Heap GDSF policy optimizes object-hit rate by keeping smaller, popular objects in cache. It achieves a lower byte hit rate than LFUDA though, since it evicts larger (possibly popular) objects. <p> <b> Heap LFUDA: Least Frequently Used with Dynamic Aging </b> - The Heap LFUDA policy keeps popular objects in cache regardless of their size and thus optimizes byte hit rate at the expense of hit rate since one large, popular object will prevent many smaller, slightly less popular objects from being cached. <p> <b> Heap LRU: Last Recently Used </b> - Works like LRU, but uses a heap instead. <p> Note: If using the LFUDA replacement policy, the value of Maximum Object Size should be increased above its default of 12KB to maximize the potential byte hit rate improvement of LFUDA.</description> + <description> + <![CDATA[ + The memory replacement policy determines which objects are purged from memory when space is needed.<br/><br/> + <strong>Heap GDSF:</strong> Optimizes object-hit rate by keeping smaller, popular objects in cache.<br/> + <strong>Heap LFUDA:</strong> Keeps popular objects in cache regardless of their size and thus optimizes byte hit rate at the expense of hit rate.<br/> + <strong>Heap LRU:</strong> Works like LRU, but uses a heap instead.<br/> + <strong>LRU:</strong> Keeps recently referenced objects (i.e., replaces the object that has not been accessed for the longest time).<br/> + Please see <a href="http://www.squid-cache.org/Doc/config/cache_replacement_policy/">cache_replacement_policy documentation</a> for additional details.<br/><br/> + Default: heap GDSF + ]]> + </description> <type>select</type> <default_value>heap GDSF</default_value> <options> - <option><name>LRU</name><value>lru</value></option> - <option><name>Heap LFUDA</name><value>heap LFUDA</value></option> <option><name>Heap GDSF</name><value>heap GDSF</value></option> + <option><name>Heap LFUDA</name><value>heap LFUDA</value></option> <option><name>Heap LRU</name><value>heap LRU</value></option> + <option><name>LRU</name><value>lru</value></option> </options> </field> <field> @@ -272,18 +357,25 @@ <field> <fielddescr>Cache Dynamic Content</fielddescr> <fieldname>cache_dynamic_content</fieldname> - <description><![CDATA[Select this option to <a target=_new href='http://wiki.squid-cache.org/ConfigExamples/DynamicContent'>enable caching of dynamic content.</a><br> - ]]></description> + <description> + <![CDATA[ + Select to <a href="http://wiki.squid-cache.org/ConfigExamples/DynamicContent">enable caching of dynamic content.</a><br/> + ]]> + </description> <type>checkbox</type> <size>10</size> </field> <field> <fielddescr>Refresh Patterns</fielddescr> <fieldname>refresh_patterns</fieldname> - <description><![CDATA[With dynamic cache enabled, you can also apply squid wiki refresh_patterns to sites like <a target=_new href='http://wiki.squid-cache.org/SquidFaq/WindowsUpdate'>windowsupdate</a><br> - <br><strong>Notes:</strong><br> - Squid wiki suggests 'Finish transfer if less than x KB remaining' on 'traffic mgmt' squid tab to -1 but you can apply your own values to control cache.<br><br> - set Maximum download size on 'traffic mgmt' squid tab to a value that fits patterns your are applying.<br>Microsoft may need 200Mb and youtube 4GB.]]></description> + <description> + <![CDATA[ + With dynamic cache enabled, you can also apply refresh_patterns to sites like <a href="http://wiki.squid-cache.org/SquidFaq/WindowsUpdate">Windows Updates</a><br/><br/> + <strong>Notes:</strong><br/> + - Squid wiki suggests setting 'Finish transfer if less than x KB remaining' on 'Traffic Mgmt' tab to -1 (but you can apply your own values to control cache).<br/> + - Set 'Maximum Download Size' on 'Traffic Mgmt' tab to a value that fits patterns your are applying. + ]]> + </description> <type>select</type> <default_value>none</default_value> <options> @@ -294,12 +386,17 @@ <option><name>Avast</name><value>avast</value></option> </options> <multiple/> - <size>06</size> + <size>05</size> </field> <field> <fielddescr>Custom refresh_patterns</fielddescr> <fieldname>custom_refresh_patterns</fieldname> - <description>Enter custom refresh_patterns for better dynamic cache. This options will be included only if dynamic cache is enabled.</description> + <description> + <![CDATA[ + Enter custom refresh_patterns for better dynamic cache usage.<br/> + <strong>Note: These refresh_patterns will only be included if 'Cache Dynamic Content' is enabled.</strong> + ]]> + </description> <type>textarea</type> <cols>67</cols> <rows>5</rows> @@ -307,16 +404,21 @@ </field> </fields> <custom_php_command_before_form> - if($_POST['harddisk_cache_size'] != $config['installedpackages']['squidcache']['config'][0]['harddisk_cache_size']) { + <![CDATA[ + if ($_POST['harddisk_cache_size'] != $config['installedpackages']['squidcache']['config'][0]['harddisk_cache_size']) { $needs_dash_z = true; } + ]]> </custom_php_command_before_form> <custom_php_validation_command> squid_validate_cache($_POST, $input_errors); </custom_php_validation_command> <custom_php_resync_config_command> + <![CDATA[ squid_resync(); - if($needs_dash_z) + if ($needs_dash_z) { squid_dash_z(); + } + ]]> </custom_php_resync_config_command> </packagegui> |