During the development phase using thinkphp, the program is often modified. If you do not disable the cache, this may cause a lot of unnecessary troubles, such as modifying the table structure, you must delete the data structure cache to see the effect. For the convenience of development, you can disable the default cache of thinkphp and enable it later.
How can I disable the thinkphp cache? You can refer to the following methods:
(1) Disable caching in the configuration file
Add the following two sentences to the config. php file:
'Tmpl _ CACHE_ON '=> false, // disable template compilation cache 'html _ CACHE_ON' => false, // disable static Cache
(2) Disable all caches in the entry file
Add the following code to the entry file:
Define ('app _ debug', TRUE); // enable the DEBUG mode define ('db _ FIELD_CACHE ', false); define ('html _ CACHE_ON', false ); // www.phpernote.com/
(3) modify the default value of the program
1. Find the \ ThinkPHP \ Common \ convention. php and \ ThinkPHP \ Common \ debug. php files.
2. Open these two files and modify them as follows:
Convention. php file:
'Tmpl _ CACHE_ON '=> false, // If the template compilation cache is enabled by default, false is used to re-compile the template 'Action _ CACHE_ON' => false, // by default, 'html _ CACHE_ON '=> false is disabled. // static cache is disabled by default.
Debug. php file:
'Tmpl _ CACHE_ON '=> false, // The template cache is enabled by default.
After the above modification, a new cache will be generated every time the program runs.
Articles you may be interested in
- Thinkphp automatic verification and automatic filling are invalid Solutions
- ThinkPHP built-in template engine usage Summary
- Summary of system constants in the Action controller of thinkphp
- How does thinkphp remove index. php from the url?
- Debugging methods required for using ThinkPHP
- Thinkphp intercepts Chinese strings
- How to set the jump wait time for the thinkphp page Jump (successerror)
- Thinkphp development skills