Cache wpdb->result
-
Dear Ajay,
I’m using your plugin and make my own function based on tptn_pop_posts to personalize outputs.
After inspecting the way you query results I’ve saw that you don’t use https://codex.www.ads-software.com/Transients_API
Query monitor plugin always show me information that tptn_pop_posts query always slowest.
So, I wrapped
$results = $wpdb->get_results( $sql );
this way:
if ( false === ( $results = get_transient( 'tptn_pop_posts_desktop_view' ) ) ) { // It wasn't there, so regenerate the data and save the transient $results = $wpdb->get_results( $sql ); set_transient( 'tptn_pop_posts_desktop_view', $results, 12 * HOUR_IN_SECONDS ); }
and got a better performance ! ??
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Cache wpdb->result’ is closed to new replies.