• Has wp_cache been disabled for plugin/theme authors?

    I can’t seem to get wp_cache_get() to retrieve my data, even though a print_r() shows it’s been added by wp_cache_add(), however only for one page-load.

    ‘WP_CACHE’, true has been added to my config in the proper place.

    Here is my code:

    global $wpdb;
    $data = wp_cache_get( 'foo_all_terms', 'all_terms' );
     if ( !data ) {
     echo 'FALSE!! GETTING TERMS and ADDING to CACHE!!';
     $query = "SELECT name FROM $wpdb->terms";
     $data = $wpdb->get_col( $query ); // array
     wp_cache_add( 'foo_all_terms', $data, 'all_terms' );
    }

    Thanks, this is really driving me nuts.

Viewing 1 replies (of 1 total)
  • Hi,
    I’m having the exact same problem with WP 2.7.1. using the KpicasaGallery Plugin. It doesn’t seem to get anything from the cache.

    I’d appreciate any suggestion.
    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Does WP_Cache work in 2.7.1?’ is closed to new replies.