-
Notifications
You must be signed in to change notification settings - Fork 863
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
Are you planning a disk-backed cache? #120
Comments
Nothing specific in the plans yet. AspNetCore already has an in-memory response cache that should be proxy compatible (it keys off response cache headers). Someone could probably adapt it to use disk storage, though the concurrency model would be trickier. Why a disk-backed cache specifically? Capacity? |
It’s fair to say it’s something on our mind though. Not on the plans for 1.0 but it should be possible to do it via the extensibility points in 1.0, and we can look at it after the first version is solid. |
Thanks. Yes, it's capacity - apps that can potentially generate 100s of GBs of highly cacheable content, that today you would (if you didn't fancy a CDN) stick IIS+ARR+cache, or Varnish, or NGINX Content Caching in front of. Would be lovely to just add Really excited by this project, btw! (What's the etiquette here - I close the issue as answered?) |
Let’s leave this open to track further caching work. We’ll put it in our post-1.0 backlog though. |
Having the option to be disk-based would really open up a lot of use cases, I believe. E.g. an integrated, disk-based cache inside a .Net Core app means fewer moving parts for a container stack. Also means you can apply logic and smarts to it locally instead of being split between the app and whatever process is doing the caching. Stretch goal for 1.0? |
Currently, this is not critical for 1.0. As mentioned above, once the core functionality is solid, we can prioritize it with other feature requests. |
@Tratcher At a high level, would someone need to just wire up an implementation of IDistributedCache to make this work? (for experimentation anyway) |
The response caching middleware linked above caches in-memory. You could certainly fork that to prototype caching to disk. AspNetCore already has FileBufferingWriteStream that would be useful here. |
Nooo, it appears its been pushed to dotnet 8 😢😢. Back to IIS+ARR/nginx we go 😭. |
Note that dotnet/aspnetcore#40229 is for output caching, not response caching. These are two separate things - output caching ignores cache-control headers. I do not see any plans to add data storage options for response caching. |
Some movement here: |
@Xhanti probably a bit premature to get too excited there, but yes; I hope we can get a FASTER-backed local-machine larger-than-RAM cache engine suitable for distributed cache, output cache, and whatever else people might want |
@mgravell understood. Early days, but even if you MS does not proceed and support it, the work you've contributed here is a good jumping off point for the next person. I am also inordinately excited for this body of work :) .This is a problem I have been thinking about for some time now |
I've been doing a lot of research and testing recently. Trying to shoehorn in my own disk cache solution using various caching libs including the new hybrid cache in dotnet 9. The biggest issue with all these existing caching libs is that they are all basically byte[] under the covers. We could try and do things like split up the body into chunks etc (basically write a stream over the top of the http/cache requests) but at this stage we may as well just implement the caching from scratch. I'm also not sure how that could be implemented with YARP as you would end up taking a single get request from a client and turning it into many range requests as you "stream" it through the cache pipeline. @mgravell do you know if FASTER/Garnet supports anything like streams that could fit this use case? |
This question is related to #109 and replacing ARR. Will reverse proxy caching be on the roadmap? Like ARR (or Varnish)?
The text was updated successfully, but these errors were encountered: