Home > PHP Framework > ThinkPHP > How to turn off the cache in thinkphp5.1

How to turn off the cache in thinkphp5.1

藏色散人
Release: 2022-12-13 09:58:56
Original
1497 people have browsed it

thinkphp5.1 How to turn off the cache: 1. Find the "\ThinkPHP\Common\convention.php" and "\ThinkPHP\Common\debug.php" files; 2. Modify the content in debug.php as follows "'TMPL_CACHE_ON' => false,"; 3. Modify the content in convention.php to "'ACTION_CACHE_ON' => false,".

How to turn off the cache in thinkphp5.1

The operating environment of this tutorial: Windows 7 system, thinkphp version 5.1, Dell G3 computer.

How to turn off the cache in thinkphp5.1?

Close the cache during Thinkphp development:

Because it needs to be modified frequently during development, the cache must be deleted frequently to see the effect.

So for the convenience of development, the cache can be removed.

Find \ThinkPHP\Common\convention.php and \ThinkPHP\Common\debug.php

Open these two files to find the settings you want.

In debug.php

'TMPL_CACHE_ON'=>false,      // 默认开启模板缓存
Copy after login

convention.php '

TMPL_CACHE_ON'   => false,  // 默认开启模板编译缓存 false 的话每次都重新编译模板
'ACTION_CACHE_ON'  => false,  // 默认关闭Action 缓存
'HTML_CACHE_ON'   => false,   // 默认关闭静态缓存
Copy after login

How to turn off all caches in ThinkPHP?

APP_DEBUG=>true 
DB_FIELD_CACHE=>false 
HTML_CACHE_ON=>false
Copy after login

Recommended study: "thinkPHP Video tutorial

The above is the detailed content of How to turn off the cache in thinkphp5.1. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template