We are using
CustomCacheKey rules for API requests. To avoid spamming the backend when prefetching, we want to receive
412 for non-cached requests.
xdn_prefetch=1 query parameter is sent within API requests as per documentation.
Everything works as expected when
cache() is called without CustomCacheKey. — responses are cached on edge and requests with
xdn_prefetch=1 are returning 200
The problem is as follows:
key looks like this:
key: new CustomCacheKey()
With such code, prefetch requests never return 200
I’ve tried to add
.excludeQueryParameters("xdn_prefetch") manually to the cacheKey but it didn’t work.