All PHP programmers know that echo "1" is executed in the PHP script, and "1" is displayed in the guest's browser.
However, when we execute the code below, we do not display "2" after "1" for 5 seconds, but wait 5 seconds to display "12"
This article mainly introduces PHP eaccelerator, memcached, XCache, APC and other 4 acceleration, cache expansion of the difference and choice of suggestions, the need for friends can refer to the following
Tossing VPS friends, after installing the
The Memcache function Library is used in the PECL (PHP Extension Community Library) to build large-capacity memory data.The temporary storage area plays an obvious role in the distributed mode. Otherwise, it is not recommended. I installed it on
Php codeSQL query Cache Suitable for readers This tutorial is applicable to PHP programmers who are interested in caching SQL queries to reduce the load on database connection and execution and improve script performance. Overview Many sites use
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 ();// when the buffer is closed, there is still content. $ Test = ob_get_contents
Function checkfile ($ file, $ cachetime = 60)
{
$ File = ROOT_PATH. '/data/cache/'. $ file. '. php ';
If (is_file ($ file ))
{
// If the file is modified (right-click the file attribute, There Is A: modification time) + cache time 60
What is cache! What can we do! In fact, the cache is equivalent to memory. Save for a while! Cache means that we do not need to execute the database when executing something. It is okay to directly execute our Cache. In general, the purpose of the
I wrote code for a program to delete folders. for details, refer.
The code is as follows:
Header ('content-type: text/html; charset = utf-8 ');
Function delFile ($ fpath ){
$ Filesize = array ();
$ Filepath = iconv ('gb2312', 'utf-8', $ fpath
I. IntroductionPHP, 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.
I. Data Cache
The data cache mentioned here refers to the database query cache. Each time you access the page, it first checks whether the cache data exists. If it does not exist, it connects to the database to obtain the data, serialize the query
Ec (2); I found it at phpx.com yesterday. Thanks to dxf218, I fixed a small problem. & lt ;? Php ** & nbsp; FileName & nbsp; & nbsp;: & nbsp; script ec (2); script
I found it at phpx.com yesterday. It's amazing.
Thanks to dxf218
I fixed a small
For example, after Vagrant file synchronization is set up, after I modify the file on OSX, I will immediately go to the vagrantcentos environment to view the file content, which is already updated, I found that the slow synchronization on the
Nginx CacheNginx has two caching mechanisms: fastcgi_cache and proxy_cache.Let's talk about the differences between the two cache mechanisms.Proxy_cache is used to cache the content of backend servers. It may be any content, including static and
The following is a detailed summary of the cache technology in php. For more information, see
The following is a detailed summary of the cache technology in php. For more information, see
Static page cachingThat is, generate all html static
Use a local environment to Test 0.1 million and 1 million cached reads and writes. The test environment and results are as follows. Environment {code ...} code {code ...} result 10 thousand {code ...} result 0.1 million {code ...} memcache10 failed
I wrote code for a program to delete folders. for details, refer.
The code is as follows:
Header ('content-type: text/html; charset = utf-8 ');Function delFile ($ fpath ){$ Filesize = array ();$ Filepath = iconv ('gb2312', 'utf-8', $ fpath );If
Copy CodeThe code is as follows:
Start caching pictures
Ob_start ();//enable output caching and temporarily cache the content to be output
Imagejpeg ($newimage, False, $quality);//Output
$data = Ob_get_contents ();//Get the cache you just
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.