Cache based on query params

Hi there,

I’ve created a custom REST-API route on my WordPress site, which looks like this:
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!


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer