WordPress.org

Support

Support » Plugins and Hacks » [Plugin: DB Cache Reloaded Fix] Clear cache for a particular query

[Plugin: DB Cache Reloaded Fix] Clear cache for a particular query

  • Josie Stauffer
    Participant

    @joanne123

    Your plugin is great for our situation, where a majority of the users will be logged-in and so cannot benefit from page caching.

    But now I’m writing my own first plugin. It generates a shortcode for insertion into a page or post. The shortcode may update a database table, and queries involving that table are cached by DB Cache Reloaded Fix.

    I have found a hacky way around the problem that works on my local installation:

    $time = time();
    $wpdb->get_results( $wpdb->prepare( “SELECT $time, my_data FROM ….. ” ..

    which changes the query each time it is run.

    1. Is there a better way?
    2. Is this going to be reliable? I’m more experienced with Oracle than with MySQL, and the MySQL documentation doesn’t make it clear that this syntax is acceptable.

    http://wordpress.org/extend/plugins/db-cache-reloaded-fix/

  • The topic ‘[Plugin: DB Cache Reloaded Fix] Clear cache for a particular query’ is closed to new replies.