HW3Cacher Advanced Installation Options
The majority of users can follow the standard installation, but for advanced usage, the following parameters are available when you edit the hw3cacher script:
|
OPTION |
PARAMETERS |
DESCRIPTION |
|
CACHE PATH |
$HWCcache_path = './cacheoutput/'; |
This setting points to the directory to cache data too. If you prefer you can place the cache path outside of the web area. If you do this, just adjust the value to the new file path. For instance if you want the cache path to be at "/big/dom/mydomain/cacheoutput" then you would create the cache directory, give it write permissions and then set this setting to: $HWCcache_path = '/big/dom/mydomain/cacheoutput/'; |
|
HW PATH |
$HWChw_path = './hw3_real.php'; |
This is the file path (not url) to the hw3 script. If you rename the hw3.php to hw3_real.php per the installation, then this does not need to be changed, but if you want to rename the hw3.php script to a different name, just adjust the file path/name in this setting. |
|
COOKIE NAME |
$HWCcookiename = 'HW3'; |
This defines the cookie name used by HW3. you only need to adjust this if you changed the cookie name in the configs/hw3.ini.php |
|
SHOW DETAILS |
$HWCshow_details = false; |
If set to "true" then the cacher will output time and memory used after outputting the HW3 output. This is primarily for testing to see the savings from the HW3Cacher script. |
|
CACHE CLEAN INTERVAL |
$HWCcache_clean_interval = 120; |
The cache script is designed to clean out the cache directory occasionally to help prevent wasting space. This setting controls the interval in minutes that the cache directory will be cleaned. Note that not all files will be removed from the cache directory. Instead for best performance, it will only remove all the files in the cache directory that are older than the Clean Interval Time. |
|
ALLOW NOCACHE |
$HWCallow_nocache = 'xxxx'; |
This setting determines if you want to allow "nocache=xxxx" to be passed in the query string to force no caching on that request. Setting this to 0 will turn off the nocache feature. Otherwise you can adjust this to any alphanumeric value you need. Then to force no caching in the query string pass "nocache=xxxx" where "xxxx" is the value you set this setting to. |
|
ALLOW CACHE CLEAR |
$HWCallow_clear = 'xxxx'; |
This setting determines if you want to allow "HWclear=xxxx" to be passed in the query string to force clearing the cache on that request. Setting this to 0 will turn off the cache clear feature. Otherwise you can adjust this to any alphanumeric value you need. Then to force cache clear in the query string pass "HWclear=xxxx" where "xxxx" is the value you set this setting to. |
|
USE SUBDIRS |
$HWUseSubDirs = 'true'; |
This setting is used to create subdirectories for storing cached web pages. This optimizes system performance by preventing too many files from being created under one directory. Some operating systems suffer severe performance issues when accessing files in a directory when this condition occurs. If set to false, cached files will be stored using the normal single cache directory method. It is highly recommended to leave this option set to true. |
|
DEFAULT CACHE TIME |
$HWCcache_time = 10; |
The global default cache time, in minutes, to cache output for. |
|
DEFAULT MIME TYPE |
$HWCmime = 'html'; |
The default mime type to use. |
|
CACHE RULES |
$HWCcache_rules |
This setting allows you to defined specific caching criteria based on patterns in the URL / query string combination. You can add a new cache rule by adding a line similar too: array( '/pattern/', Cache? True or False, max cache time in minutes, optional cachename_prepend, optional mime) The '/pattern/' will be compared against the url/querystring. If the pattern matches then the rule will be used to determine the caching criteria. Additionally you can have '!/pattern/'. In this case, if the pattern does NOT match, then the rule will be used to determine the caching criteria. if "Cache? " is set to true then, when the rule is used we will cache, if false then the rule means do not cache. "Max cache time in minutes" allows you to override the default max cache time. "optional cachename_prepend" allows you to add a string of text to prepend to the cache file names. Useful for debugging. "optional mime [html by default]" allows you to define a new mime type to use instead of the default. The optional mime types supported are: js, html, xml, mp3, wav, png, jpg, gif The default mime type "html" is assumed if none are specified. A good example of a rule that limits warnings to being cached for 1 minutes would be: array( '/forecast=warnings/', true, 1, 'warnings_') Here, if the query string has "forecast=warnings" then we will cache, but with a max cache time of 1 minute. Additionally we will prepend the cache file name with the text: "warnings_" Cache Rules are tested in order they are defined, and once a cache rule pattern matches the url/query string combination, then no further rules will be processed. |