note 97502 modified in function.memcache-set by danbrown
| From: | danbrown@php.net | Date: | Fri, 23 Apr 2010 12:33:05 +0000 |
| Subject: | note 97502 modified in function.memcache-set by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168552@lists.php.net to get a copy of this message | ||
if you want to cache an image created on-the-fly you can do:
<?php
ob_start();
imagepng($image);
$memcache->set("my_image", ob_get_contents(), false, $cache_time);
ob_end_clean();
?>
then you could access the chached image as simple variable:
<?php $my_image = $memcache->get("my_image"); ?>
so, in short, you have to buffer the output
--was--
if you want to cache an image created on-the-fly you can do:
ob_start();
imagepng($image);
$memcache->set("my_image", ob_get_contents(), false, $cache_time);
ob_end_clean();
then you could access the chached image as simple variable:
$my_image = $memcache->get("my_image");
so, in short, you have to buffer the output
http://php.net/manual/en/function.memcache-set.php