Comments (7)
We can't pre-populate the cache until actual requests are done. The best solution in such environment is to use a distributed cache like redis, AppFabric or else.
Our redis deployment shows nice performance (slower than memory of course).
You could make requests automatically from a script to fill up things too.
So yeah, this solution already exists using little tricks you can achieve what you want.
from mvcdonutcaching.
Thanks for the response - I just thought, given there is a mechanism for using a SQL / distributed cache, there must be a way to load that data back into memory.
Something like this:
- Request comes in, cache data created and stored in memory & on backup (SQL / dsitributed)
- Subsequent requests served from memory.
- Timeouts are handled and evictions impact memory & backup.
- On app recycle / restart, backup data gets loaded into memory.
Sorry for my ignorance, I really do need to delve into the code more, but I feel like the above seems feasible? Can I ask what I'm missing?
Thanks again for the speedy response!
from mvcdonutcaching.
I have implemented the above using a custom cache provider:
https://gist.github.com/dazbradbury/fe49f77acae71c8479d2
Let me know what you think, but it seems to be working pretty solidly for me!
from mvcdonutcaching.
It's a nice way to implement the things. If it works for you, that's good.
from mvcdonutcaching.
OK cool - I'll finalise my code and update the gist. Maybe you can link to it from the Readme if you think others will find it useful.
On a related note, using the above it's difficult to run code remotely, as you encrypt all data here using the MachineKey:
https://github.com/moonpyk/mvcdonutcaching/blob/master/DevTrends.MvcDonutCaching/Encryptor.cs
I find it interesting any encryption is required, can you explain the reasoning?
I guess the assumption is that donut holes may contain sensitive information, but this seems like additional functionality (the standard outputcache does not do this) - is it safe to bypass this?
from mvcdonutcaching.
It's an heritage from legacy code that I've chosen to keep. Encryption is only used for serialiazing action parameters inside view for later processing. If for some reason, processing doesn't work you could be exposing sensitive internal application details (view names, controller names, etc.)
Again, it's your choice.
from mvcdonutcaching.
Ah OK - good to know.
I'll replace with a different algo that doesn't rely on the machine key.
Thanks again for the reply.
On 19 Mar 2014 13:49, "Clément Bourgeois" [email protected] wrote:
It's an heritage from legacy code that I've chosen to keep. Encryption is
only used for serialiazing action parameters inside view for later
processing. If for some reason, processing doesn't work you could be
exposing sensitive internal application details (view names, controller
names, etc.)Again, it's your choice.
Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-38052094
.
from mvcdonutcaching.
Related Issues (20)
- help,if custom RouteConfig,the 'area' parameter not work in asp.net mvc HOT 5
- Sometimes application cache throws System.Web.HttpException HOT 2
- Clear cache with return View doesn't work HOT 1
- FileResult getting corrupted
- Server crash on creating cache item
- MvcDonutCaching doesn't work on ChildActions? HOT 5
- Cache expiry policy
- Missing null check in KeyGenerator.cs HOT 2
- Not working with route attribute
- abstract controller class derived as regular controllers in two different areas hits same cache
- Filtering is not allowed. While implementing Donut Caching.
- getting "Object reference not set to an instance of an object" while generating a key HOT 1
- cache only non-authenticated pages HOT 2
- Serialization error when trying to pass model object to child action using action method extension of Donutcache HOT 1
- unnecessary Comments were adding HOT 2
- Order of route values shouldn't impact key built HOT 1
- Can i change input database of mvcdonutcaching?
- RemoveItems does not pass routeValues to build the key causing RemoveItems to fail
- Cache profile Server, but still different results on different browsers/machines
- Asp.net Core Support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mvcdonutcaching.