-
Notifications
You must be signed in to change notification settings - Fork 218
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
Distributed Caching support #411
Comments
Thanks for the feedback. The inspiration for the cache was based on the article linked to in the header of the file. As per the article:
Although I went through at least 3 different variations of the design before settling on this one, I didn't really consider what would happen if you tried to implement a distributed cache. I agree that this is something that should be addressed.
The lazy lock is empty when it is stored. Then the I am not sure there is a way to support both a non-blocking cache and a distributed cache with the same design, but if you have any ideas about how to implement a solution I would be happy to see them. |
I think the main thing we would need to do is focus on getting the ISiteMap, SiteMap to a simple serializable object which makes this translate to just a hierarchy of nodes. We would need to pull out the injection of services/providers into this object and move that into another service/provider that would be responsible for building the hierarchy. Those would need to be separated because as it is right now those objects cannot be serialized. Maybe the locking becomes the priority of the ICacheProvider itself if necessary. I started to go through the code and currently I am working to simplify the SiteMap object to a basic hierarchy and move the other responsibilities. I have nothing solid at the moment but just want to give you a heads up on the direction I am trying to go with this. I feel this approach would be the starting ground for supporting both in memory and distributed cache. |
One thing to keep in mind is MVC6/DNXCore50 support. One option on the table is just to let Since we are basically talking about a new design here (ISiteMap into a Model-like object), would you be interested in contributing to the effort? Some things I would like to see happen:
Joe Audette (the one who opened the MVC6 topic) has a big head start - he has a working implementation on DNX Core 50. There are several ideas he came up with that I like, such as using a ViewModel to adjust the title, description, and URL for each request. However, his implementation is part of a "do-it-all" framework, which is not an approach I agree with. Also, he has not yet implemented the caching and currently has all of his nodes in trees of One thing I have been considering is to use a decorator pattern around the MVC |
I agree on moving forward on an MVC6 approach, but do feel that there are some out there that may need the MVC5 changes as well. Maybe I will put together a separate forked MVC5 version with my suggested changes in the meantime for my usecase and others who may need the same. I don't mind helping out with this initiative, let's try to coordinate the ideas and get a roadmap planned. I agree with removing the Dynamic Node provider and bringing them together as a first class feature (Dynamic Node provider has been very useful and I'm sure no one would want that completely gone) |
MVC5?? There already is support for MVC 5. |
First off, awesome library, its very useful and configurable. On another note, distributed caching isn't supported in this library. I implemented my own provider but then realized a few things:
https://github.com/maartenba/MvcSiteMapProvider/blob/master/src/MvcSiteMapProvider/MvcSiteMapProvider/Caching/ICacheProvider.cs
I've already forked and started to move things around as needed for my use, just wanted to run that by the community to see what everyone's thoughts are. I can have a code sample available pretty soon as well. I hope I made the issue/suggestions clear, but please comment and let me know if this does sound crazy, I'm sure what you did was intentional, if you could shine some light on what your reasoning was and what we may run into by altering this?
Simplest route we could potentially move the lazy.Get call to prior to adding to cache:
https://github.com/maartenba/MvcSiteMapProvider/blob/master/src/MvcSiteMapProvider/MvcSiteMapProvider/Caching/MicroCache.cs#L73
The text was updated successfully, but these errors were encountered: