The cache is widely used in practice, which can reduce the access to the server database and improve the running speed. At present, many CMS content management systems frequently use caching mechanism to improve the efficiency of system operation.
PHP, a Web design scripting language that has emerged in recent years. due to its powerful and scalability, PHP has developed considerably in recent years. Compared with traditional ASP websites, it has an absolute advantage in speed. if you want
This function is mainly to use the file modification time function Filemtime and the current time for subtraction to determine whether the content is updated.
$cahetime =2;//Setting the expiration time$cahefile = "Cahe.txt";//Read and write text
for ($i =0; $i Ob_start ();
echo "This is iteration $i:";
* Dont do this!
$buf = Ob_get_contents ();
Ob_clean ();
* Use this instead:
$buf = Ob_get_flush ();
//
the buffer is closed and there is still content.
$test =ob_get_contents ();
echo $test,-
function Checkfile ($file, $cachetime =60)
{
$file =root_path. ' /data/cache/'. $file. PHP ';
if (Is_file ($file))
{
If the file is modified (right click on this file property, there is a: modified time) + cache time 60 seconds > current system
Nginx CacheNginx has two kinds of caching mechanisms: Fastcgi_cache and Proxy_cache
Let's talk about the difference between the two caching mechanisms.
The Proxy_cache role is to cache the contents of the backend server, possibly any content,
As far as I am concerned, PHP uses Memache or Redis cache data, when the data has updated data, according to the label to clear out the data, then there is a set of automatic update strategy?
Reply content:
As far as I am concerned, PHP uses
Copy the Code code as follows:
This function is mainly to use the file modification time function Filemtime and the current time for subtraction to determine whether the content is updated.
$cahetime =2;//Setting the expiration time
$cahefile =
Nginx CacheNginx has two kinds of caching mechanisms: Fastcgi_cache and Proxy_cache
Let's talk about the difference between the two caching mechanisms.Proxy_cacheThe role is to cache the contents of the backend server, which may be anything,
Full page static cacheThat is, the page is all generated HTML static page, the user accesses the static page directly, but not to go to the PHP server parsing process. This way, in the CMS system is more common, such as dedecms;
A more common way to
I. INTRODUCTION: PHP, a web design scripting language that has emerged in recent years, has been greatly developed in recent years due to its powerful and scalable nature. Compared with traditional asp websites, php, absolute speed
I.
The cache is widely used in practice, which can reduce the access to the server database and improve the running speed. At present, many CMS content management systems frequently use caching mechanism to improve the efficiency of system operation.
Ratemax) {}else{ memcache_increment ($link, $key);}?>
Each refresh is changed without a cache
After caching
Demo Address http://niaochen006.sinaapp.com/zq.php
Cache time 20 seconds change once
What I want to achieve
The Memcache function library is in PECL (PHPExtensionCommunityLibrary). It is mainly used to set up a temporary storage area for large-capacity memory data. its function is obvious in distributed mode, otherwise it is not recommended to use it.
Wednesday,-JasonXcache is a fast and stable PHP opcode cache. it has been well tested and runs stably on high-traffic/high-load production machines. tested on Linux and supports the latest of all existing PHP branchesReleased, such as php4.4 php5.2,
What is Memcache?Memcache is a danga.com project that was first used for LiveJournal. Many people around the world use this cache project to build their own websites with high load, to share the pressure on Database tutorials.It can cope with any
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.