Static cache suppression for thinkphp

Source: Internet
Author: User

Recently made with thinkphp Enterprise station,thinkphp inside a static cache function a variety of powerful cache, lingering. Now that you're not using the static caching feature, think about how to disable caching. For this cache, take a look at some of its core libraries. There are many ways to explain the principle and usage of caching mechanism, that is, how to forbid it. This record is shared and available for review.

  Thinkphp in the data cache, including file mode, shared memory mode and database mode in a variety of ways to cache, through the plug-in method can also increase the need for later cache classes, so that application development can choose more suitable for their own cache, so as to effectively improve the efficiency of application execution. Currently supported caching methods include: File, Db, Apc, Memcache, Shmop, Sqlite, Xcache, Apachenote, and Eaccelerator

  For the convenience of development, the cache can be removed first.

  There are several ways to refer to:

(1) In the configuration file config.php We simply add the following two sentences to the file:

          ' tmpl_cache_on ' = false,//prohibit template compilation cache
' html_cache_on ' = false,//disable static caching

(This person feels more troublesome, but also in each module configuration inside Add.) )

(2) Close all caches in the portal file:

          Define (' App_debug ', TRUE); Turn on debug mode
Define (' Db_field_cache ', false); Prohibit template compilation cache
Define (' html_cache_on ', false); Disable static caching

(3) modify it in the default configuration. Go inside The framework catalog thinkphp\conf to discover convention.php and debug.php.

          In debug.php

' tmpl_cache_on ' =>false,//Open template cache by default

          In convention.php

Tmpl_cache_on ' = False,//default to turn on the template compilation cache false to recompile the template every time

' action_cache_on ' = false,//close ACTION cache by default

' html_cache_on ' = false,//default off static cache

I use the third, the individual think the cache settings are not often to be modified, there is no need to use the second in the import file, the first I directly rejected, hehe. You know.

 

  

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.