Cache the image generated by gd to memcahe. Print? Start to cache the image ob_start (); enable the output cache, and temporarily cache the output content imagejpeg ($ newimage, false, $ quality); output $ dataob_get_contents (); get the print? // Start to cache images
Ob_start (); // enable the output cache to temporarily cache the output content
Imagejpeg ($ newimage, false, $ quality); // output
$ Data = ob_get_contents (); // Obtain the cache you just obtained
Ob_end_clean (); // clear the cache
$ Mem = get_memcache (); // modify it by yourself
$ Mem-> set ($ mem_key, $ data, 720000); // Save the obtained output to memcache.
Echo $ data; // output image
And then display it like this.
$ Mem = get_memcache (); // modify it by yourself
$ Data = $ mem-> get ($ mem_key );
If ($ data ){
Echo $ data;
Exit ();
}
Http://www.bkjia.com/PHPjc/477491.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477491.htmlTechArticleprint? // Start to cache the image ob_start (); // enable the output cache and temporarily cache the output content imagejpeg ($ newimage, false, $ quality ); // Output $ data = ob_get_contents (); // get just...