How can I use memcache to access the template cache?

Source: Internet
Author: User
How can I use memcache to access the template cache? Cache

To make the website faster. Please give me some advice !!


Reply to discussion (solution)

It is nothing more than checking whether there is a cache in memcache before reading the database. if it hits the cache, it directly retrieves the data cached in memcache and then reads the data in the database if it does not hit the cache.

It is nothing more than checking whether there is a cache in memcache before reading the database. if it hits the cache, it directly retrieves the data cached in memcache and then reads the data in the database if it does not hit the cache.
But how can we make the cache in memcache run like code?


It is nothing more than checking whether there is a cache in memcache before reading the database. if it hits the cache, it directly retrieves the data cached in memcache and then reads the data in the database if it does not hit the cache.
But how can we make the cache in memcache run like code?

Memcached caches data (various data, objects, arrays, etc ..), If you need template caching, you need a template caching engine similar to smarty.

Php. ini
Allow_url_include = on

Include "data: //,". content read from memcache


It is nothing more than checking whether there is a cache in memcache before reading the database. if it hits the cache, it directly retrieves the data cached in memcache and then reads the data in the database if it does not hit the cache.
But how can we make the cache in memcache run like code?

Memcache stores content such as key => value. it can be used only after it is read. You save an "edho 'hello';". after reading it, you can use eval () to execute it.

MC is suitable for storing data. For a publish page, you can directly generate a static page.

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.