Thinkphp Method for disabling cache _ php instance

Source: Internet
Author: User
This article mainly introduces Thinkphp's method of disabling caching. During development projects, it is often difficult to use caching. Therefore, there is always a way to disable caching, for more information, see modify the cache frequently during development. Therefore, you must delete the cache frequently to see the effect.

Therefore, cache can be removed for ease of development.

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

2. Open these two files and find the settings you want.

Debugging. php

The Code is as follows:


'Tmpl _ CACHE_ON '=> false, // The template cache is enabled by default.


In convention. php'

The Code is as follows:


TMPL_CACHE_ON '=> false, // If template compilation cache is enabled by default, the template is re-compiled every time.

'Action _ CACHE_ON '=> false, // ACTION cache is disabled by default.

'Html _ CACHE_ON '=> false, // The static cache is disabled by default.


How does thinkphp disable all caches? (The answer that baidu knows is satisfactory)

The Code is as follows:


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.