'Is ResponseCache default to vary by all query keys?

I am very puzzled. I have a response cache profile defined to vary by a header, I can confirm the header is the same for all requests

options.CacheProfiles.Add(CacheProfiles.MediumVaryByUser, new CacheProfile {Duration = 14400, VaryByHeader = "X-ResponseCacheToken", NoStore = false});

Yet it also varies by the parameter values

public async Task<IActionResult> HasPermission(string permissionName, Guid? menuItemTypeId)

although I didn't specified VaryByQueryKeys = new []{"*"}

even If I specify to vary only by the second parameter VaryByQueryKeys = new []{"menuItemTypeId"} it also varies on the first one.

Maybe is it because the params are included in the route?

  [Route("[area]/[controller]/[action]/{permissionName}/{menuItemTypeId?}")]

I believe I am missing something here, in my understanding and I would need some explanations. Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source