Open the cached configuration file/application/common/conf/cache.php source code is as follows:
<?phpreturn Array( //'Configuration Items' = 'Configuration Values' ' layout_on '=true, ' html_cache_on '=Strpos($_server[' Http_host '], '. ') !== false, // turning on static caching defaults totrueLocal does not open ' Html_cache_time '=3600, // global Static cache validity period (seconds) ' Html_file_suffix '='. shtml ', // set the static cache file suffix ' Html_cache_rules '=Array( ' * '=Array(' {: Module}/{:controller}/{:action}/{$_server. REQUEST_URI|MD5} ', 3600, ' TRIMSW '), ));
Note: the TRIMSW behind is to remove all non-/\w strings, preventing certain system errors from entering special characters such as Chinese.
The source of the function TRIMSW:
/** * @author [email protected] * @descriptionremove spaces and non-\wstring that is used toCacheConfiguration * * @param$str * @paramstring $emptyValue * * @returnmixed|string */functionTRIMSW ($str, $emptyValue= ' _empty_ '){ $str= Preg_replace('/([^\w\/]+)/', '-', $str); if(Empty($str)) { $str= $emptyValue; } return$str;}
Thinkphp 3.2 Opening Cache cache considerations, filtering illegal characters