[wp-trac] [WordPress Trac] #4476: Delete Cache by Group
    WordPress Trac 
    wp-trac at lists.automattic.com
       
    Mon Jun 18 17:34:35 UTC 2012
    
    
  
#4476: Delete Cache by Group
-----------------------------+------------------------------
 Reporter:  filosofo         |       Owner:  anonymous
     Type:  enhancement      |      Status:  closed
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Cache            |     Version:  2.2
 Severity:  normal           |  Resolution:  wontfix
 Keywords:  has-patch close  |
-----------------------------+------------------------------
Comment (by scribu):
 Actually, you don't change the prefix of the group, but add a prefix to
 each individual key:
 {{{
 $ns_key = wp_cache_get( 'foo_namespace_key' );
 // if not set, initialize it
 if ( $ns_key === false )
   wp_cache_set( 'foo_namespace_key', 1 );
 $my_key = "foo_".$ns_key."_12345";
 $my_value = wp_cache_get( $my_key, 'some_group' );
 }}}
 To clear the namespace do:
 {{{
 wp_cache_incr( 'foo_namespace_key' );
 }}}
 Source:
 https://groups.google.com/forum/?fromgroups#!topic/memcached/Izov0cFjBXI
-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/4476#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
    
    
More information about the wp-trac
mailing list