note 97502 modified in function.memcache-set by danbrown

From: Date: Sat, 19 Jun 2010 03:56:38 +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-170270@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: <?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 http://php.net/manual/en/function.memcache-set.php

« previous php.notes (#170270) next »