• Resolved mjulien

    (@mjulien)


    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

    (@mjulien)

    Checking the code, we explicitly don’t cache empty result. Why is it so?

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @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.