Skip to content

Add Implementation of ObjectCache using Redis - #72

Open
Remy Blok (remyblok) wants to merge 6 commits into
Azure:mainfrom
remyblok:master
Open

Remy Blok (remyblok) wants to merge 6 commits into
Azure:mainfrom
remyblok:master

Conversation

@remyblok

Copy link
Copy Markdown

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.

@mapalan

Copy link
Copy Markdown
Contributor

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

@jknopp

Copy link
Copy Markdown

Maran Palaniappan (@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

Jon Cole (JonCole) commented May 19, 2020

Copy link
Copy Markdown
Contributor

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

Maran Palaniappan (mapalan) commented May 19, 2020

Copy link
Copy Markdown
Contributor

Jon Cole (@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

Jon Knopp (jknopp) commented May 19, 2020

Copy link
Copy Markdown

Jon Cole (@JonCole) Maran Palaniappan (@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
Stanley Small (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