dotnet / dotnet/aspnetcore

Purpose of VaryByRouteValueNames

Open
#65,278 0 comments 0 reactions 0 assignees View on GitHub
area-middleware feature-output-caching
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

Hi, I’m a bit confused about the purpose of VaryByRouteValueNames. The effect seems to be that it adds to the cache key a value whose name and value are taken from the route. However, at the moment the cache key already includes the entire path, including any values from which the variable parts are extracted.

Is there a use case where it’s suggested/required/mandatory to specify VaryByRouteValueNames, if the entire path is already part of the cache key?

Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.