dotnet / dotnet/aspnetcore

OutputCaching make IOutputCacheKeyProvider public

Open
#43,747 6 comments 1 reaction 0 assignees View on GitHub
area-middleware feature-output-caching
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

Hello,

I've been playing around with using the new OutputCaching middleware that was introduced in dotnet 7 preview 6 and I have a requirement to implement my own cache key provider.

Basically I would like to ignore the host header in the incoming request but I also conceive a scenario where I would like to do only path based keys.

I'm currently working around this by using middleware to set the host header to null before it goes to the endpoint that's being cached.

If IOutputCacheKeyProvider was public and injected in AddOutputCache() the same way as IOutputCacheStore then I could simply inject my own implementation before calling AddOutputCache().

Thanks,
Nick

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.