apc cache compression
Posted
by
Massimo
on Stack Overflow
See other posts from Stack Overflow
or by Massimo
Published on 2011-02-14T23:18:52Z
Indexed on
2011/02/14
23:25 UTC
Read the original article
Hit count: 198
I want to store some key value. I see memcache api supports on-the-fly compression: memcache_set( obj, var, value, MEMCACHE_COMPRESSED, ttl )
What about apc ? I cannot find any doc.
My goal, for example in php :
function cache( $key, $value )
{
$data = serialize( $value );
if ( strlen( $data ) >= 1024 )
$data = 'z' . gzcompress( $data, 1 );
else
$data = '=' . $data;
return apc_store( $key, $data, $ttl );
}
© Stack Overflow or respective owner