• Resolved mcsr

    (@mcsr)


    Hi there,

    I’ve created a custom REST-API route on my WordPress site, which looks like this: https://mydomain.com/wp-json/namespace/v1/custom-route?query=test
    The custom route is mostly based on query parameters.

    It seems to me that WP REST Cache is not caching based on the query is there a way to include this and other query parameters into the cache key? There should be an individual item in the cache for each query parameter, that is being passed to the route.

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @mcsr

    Thank you for using our plugin!

    It is not because of the query parameter, custom endpoints aren’t cached by default. You can tell our plugin to cache your endpoint as described in our FAQ

    Thread Starter mcsr

    (@mcsr)

    Thanks @rockfire ! Now it’s working.

    Really like your plugin because it works in nearly any environment without significant changes to the configuration ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cache based on query params’ is closed to new replies.