Skip to content

Cache Lookup vary-by-query-parameter not working #211

Description

Report

Cache Lookup policy should by default cache separately by all query parameters as stated in the documentation at vary-by-query-parameter. Even when specifying the caching with vary-by-query-parameter element the caching still doesn't respect the caching. I would expect the query would be reflected in the cache key, which is not e.g. 3_apimtestwe.azure-api.net.23_static-api_static-api-uat;rev=1.38718_GetTenantApplicationsFooter.37979_8_https_graphql-we-uat.services.ori_443_/tenants/ee/applications/footer

Expected Behavior

Cache would take into account the query parameters.

Actual Behavior

CacheLookup with vary-by-query-parameter should store backend request separately based on the query parameters defined.

Steps to Reproduce the Problem

  1. Define /tenants/{tenant}/applications/footer?lang={lang} endpoint
  2. Define policy with <cache-lookup> with <vary-by-query-parameter>lang</vary-by-query-parameter> element
  3. Call the endpoint with different lang values
  4. The cache should contain multiple entries differing based on the query parameter

Logs from self-hosted gateway

None

Self-hosted Gateway Version

2.2.0

Deployment

Self-Managed (YAML/Helm)

Platform

Microsoft Azure

Kubernetes Version

1.25

Anything else?

The issue is reproducible on Managed API Management as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions