array (
'tags' => array (
'tag1' => <......>,
'tag2' => <......>
),
'data' => <.... ...>,
);
* This source code was highlighted with Source Code Highlighter .
// post_1:
array (
'tags' => array (
'posts' => 1
),
'data' => 'post content'
)
// tag_posts:
array (
'data' => 1
)
* This source code was highlighted with Source Code Highlighter .
$config[ 'modules' ] = array
(
//.....
MODPATH. 'memcacheimp' , // Memcacheimp driver
//.....
);
// , cache.php:
$config[ 'default' ] = array
(
'driver' => 'memcacheimp' ,
'lifetime' => 3600,
'requests' => 1000,
);
* This source code was highlighted with Source Code Highlighter .
$cache = new Cache();
// :
$cache-> set ( 'post_1' , 'post content' , array( 'posts' ));
$cache-> set ( 'post_2' , 'post content' , array( 'posts' ));
//
$ value = $cache-> get ( 'post_1' );
// $value == post content
// "" . , , tag_posts, post_1 post_2 -
$cache->delete_tag( 'posts' );
// post_1
$ value = $cache-> get ( 'post_1' );
// $value === NULL, . post_1 , , .. .
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/73423/