apc cache compression
- by Massimo
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 );
}