Title: Query Cache not work
Last modified: October 23, 2017

---

# Query Cache not work

 *  Resolved [zu2](https://wordpress.org/support/users/zu2/)
 * (@zu2)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/query-cache-not-work/)
 * diff -uNr wordpress-popular-posts.orig/public/class-wordpress-popular-posts-public.
   php wordpress-popular-posts/public/class-wordpress-popular-posts-public.php
    —
   wordpress-popular-posts.orig/public/class-wordpress-popular-posts-public.php 
   2017-10-22 02:33:14.000000000 +0900 +++ wordpress-popular-posts/public/class-
   wordpress-popular-posts-public.php 2017-10-24 04:03:25.000000000 +0900 @@ -445,6
   +445,7 @@ case ‘year’: $time = 60 * 60 * 24 * 365; break; + }
 *  $expiration = $time * $this->admin_options[‘tools’][‘cache’][‘interval’][‘value’];
 * @@ -464,8 +465,6 @@
    } }
 * – }
    – }
 *  $cached = true;
    -  This topic was modified 8 years, 6 months ago by [zu2](https://wordpress.org/support/users/zu2/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/query-cache-not-work/#post-9613273)
 * Please explain in full detail what’s going on, what you posted doesn’t tell me
   anything. Include reproduction steps and other info you feel I might find useful.
 *  Thread Starter [zu2](https://wordpress.org/support/users/zu2/)
 * (@zu2)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/query-cache-not-work/#post-9613319)
 * In public/class-wordpress-popular-posts-public.php :
 * This program is trying to cache the results of WP_Query.
    However, because the‘}’
   position of the switch statement is incorrect, this is not working. This problem
   has occurred since 4.0.0.
 * thanks.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/query-cache-not-work/#post-9613343)
 * Thanks! Alright, I’ll look into it as soon as possible.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/query-cache-not-work/#post-9613607)
 * [Fixed it](https://github.com/cabrerahector/wordpress-popular-posts/commit/d1678c93796590800e2f0b5e39a19bf6aa786dbd)!
   An update will follow in a few hours, so please upgrade as soon as possible.
 * Thanks for the heads-up!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Query Cache not work’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

## Tags

 * [transients](https://wordpress.org/support/topic-tag/transients/)

 * 4 replies
 * 2 participants
 * Last reply from: [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/query-cache-not-work/#post-9613607)
 * Status: resolved