Home > Article > Backend Development > Thinkphp method to turn off caching_PHP tutorial
This article mainly introduces the method of turning off the cache in Thinkphp. It is often necessary to play with it when developing projects. It is not convenient if there is a cache, so it is always out. How to turn off the cache, friends who need it can refer to it
Because it needs to be modified frequently during development, the cache must be deleted frequently to see the effect.
Therefore, for the convenience of development, the cache can be removed.
1. Find ThinkPHPCommonconvention.php and ThinkPHPCommondebug.php
2. Open these two files and find the settings you want.
debug.php
The code is as follows:
'TMPL_CACHE_ON'=>false, // Template caching is enabled by default
Convention.php in '
The code is as follows:
TMPL_CACHE_ON' => false, // Enable template compilation cache by default. If false, recompile the template every time
'ACTION_CACHE_ON' => false, // Action cache is turned off by default
'HTML_CACHE_ON' => false, // Turn off static caching by default
How to turn off all caches in thinkphp? (Satisfactory answer that Baidu knows)
The code is as follows:
APP_DEBUG=>true
DB_FIELD_CACHE=>false
HTML_CACHE_ON=>false