false,"; 3. Modify the content in convention.php to "'ACTION_CACHE_ON'=>false,". Turn off the cache when developing Thinkphp: Because it needs to be modified frequently during development, from"/> false,"; 3. Modify the content in convention.php to "'ACTION_CACHE_ON'=>false,". Turn off the cache when developing Thinkphp: Because it needs to be modified frequently during development, from">
search
HomePHP FrameworkThinkPHPHow to turn off the cache in thinkphp5.1

How to turn off the cache in thinkphp5.1

Jun 01, 2023 pm 02:55 PM
thinkphp

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

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,      // 默认开启模板缓存

convention.php in '

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

How to turn off all caches in ThinkPHP?

APP_DEBUG=>true 
DB_FIELD_CACHE=>false 
HTML_CACHE_ON=>false

What is thinkphp

thinkphp is a free development framework that can be used to develop front-end web pages. Thinkphp was first created to simplify development. Thinkphp also follows the Apache2 protocol. It originally evolved from Struts and also adapted some good foreign framework models. Utilize, use the object-oriented development structure, and be compatible with many tag libraries and other modes. It can develop and deploy applications more conveniently and quickly. Of course, it is not just enterprise-level applications. Any PHP application development can start from thinkphp's simplicity, compatibility and Benefit from fast features.

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!

Statement
This article is reproduced at:亿速云. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment