Title: Doesn&#8217;t cache empty results
Last modified: May 10, 2023

---

# Doesn’t cache empty results

 *  Resolved [mjulien](https://wordpress.org/support/users/mjulien/)
 * (@mjulien)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/doesnt-cache-empty-results/)
 * I have set up WP rest cache with woocommerce endpoints with instruction found
   on the forum, but it doesn’t cache the request that return an empty list. For
   example, if I call /wp-json/wc/v3/products/?order=asc&page=1&category=211&per_page
   =15&status=publish&orderby=title, it will serve a cached result, but for /wp-
   json/wc/v3/products/?order=asc&page=2&category=211&per_page=15&status=publish&
   orderby=title, it will never cache the request. I did some test and it seems 
   consistent that when the result is a json empty set [], the request is not cached.

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

 *  Thread Starter [mjulien](https://wordpress.org/support/users/mjulien/)
 * (@mjulien)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/doesnt-cache-empty-results/#post-16727028)
 * Checking the code, [we explicitly don’t cache empty result](https://github.com/acato-plugins/wp-rest-cache/blob/e7c26135b2e242ebb180dc75f81d669ac742adc3/includes/api/class-endpoint-api.php#LL253C6-L253C6).
   Why is it so?
 *  Plugin Author [Richard Korthuis](https://wordpress.org/support/users/rockfire/)
 * (@rockfire)
 * [3 years ago](https://wordpress.org/support/topic/doesnt-cache-empty-results/#post-16729853)
 * Hi [@mjulien](https://wordpress.org/support/users/mjulien/)
 * Thank you for using our plugin!
   Good question, we explicitly do not cache empty
   result sets, because in our experience this is an unwanted situation and often
   even an error.I have seen your pull request and I think it is a good idea to 
   implement a filter like that. Unfortunately at this moment I do not have time
   to review and test it and to deploy a new version. I will get back to you but
   that will not be this or next week.

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

The topic ‘Doesn’t cache empty results’ is closed to new replies.

 * ![](https://ps.w.org/wp-rest-cache/assets/icon-256x256.png?rev=3328849)
 * [WP REST Cache](https://wordpress.org/plugins/wp-rest-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-rest-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-rest-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-rest-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-rest-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-rest-cache/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Richard Korthuis](https://wordpress.org/support/users/rockfire/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/doesnt-cache-empty-results/#post-16729853)
 * Status: resolved