Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Implementation of ObjectCache using Redis #72

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

remyblok
Copy link

The System.Runtime.Caching.ObjectCache has only a default in-memory inplementation. I have added a implementation using Redis Cache so that the object cache can be shared over multiple instances of an app.

I used the same project structure as used for the Output Cache and Session State Provider. My goal was to reuse as much existing code as possible. The project also includes unit and functional test.

@Azure Azure deleted a comment from msftclas Sep 26, 2017
@Azure Azure deleted a comment from msftclas Sep 26, 2017
@mapalan
Copy link
Member

mapalan commented May 15, 2020

Hi @remyblok, apologies for the incredibly long response time. Is this something you would still like to see?

@jknopp
Copy link

jknopp commented May 19, 2020

@mapalan I would still like to see this added. Without it, my understanding is that there isn't a way to allow the RedisOutputCacheProvider to cache partial view/child actions. Even with the output cache configured for Redis, child actions will still use the in-memory object cache.

@JonCole
Copy link
Contributor

JonCole commented May 19, 2020

Is this referring to System.Runtime.Caching.ObjectCache? It feels very odd to me to stick this non-ASP.NET specific implementation into a package targeted at ASP.NET scenarios. What happens if the code is accidentally referring to objects that are only meant to be used in ASP.NET hosted environments? While I can certainly understand the desire to get the benefits of code-reuse, this seems like it will be problematic in the long term. Have I misunderstood something here?

@mapalan
Copy link
Member

mapalan commented May 19, 2020

@JonCole that is what it's referring to. Similar to #141, this feature seems to be out of scope for this repository, which is trying to be faithful to the two ASP.NET providers.

@jknopp
Copy link

jknopp commented May 19, 2020

@JonCole @mapalan does that mean that there will be no supported method for using Redis output cache on partial views decorated with System.Web.Mvc.OutputCacheAttribute? This will only work on "parent" actions? If so, documentation to explain the limitations may be helpful to prevent similar issues.

@stanleysmall-microsoft stanleysmall-microsoft changed the base branch from master to main May 11, 2022 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants