alastairtree / LazyCache

An easy to use thread safe in-memory caching service with a simple developer friendly API for c#
https://nuget.org/packages/LazyCache
MIT License
1.72k stars 159 forks source link

Saving Cached Object To Disk For Loading Between Application Executions #116

Open Sn3akyP3t3 opened 4 years ago

Sn3akyP3t3 commented 4 years ago

[Use the Thumbs Up reaction to vote for this feature, and please avoid adding comments like "+1" as they create noise for others watching the issue.]

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like Neither documentation or the example source code show examples of saving the cache to disk in between running of the application. I don't know if this is an existing feature that just lacks documentation or neither. Whichever the case this is a feature request to fill that gap or gaps.

Describe alternatives you've considered Finding another library that can save the content of an object to disk like Python Pickle maybe...?

Additional context N/A

alastairtree commented 4 years ago

Very happy if someone would like to contribute a feature like this by implementing a new cache provider. Would suggest serialising objects using something fast like the MongoDB BSON serilaiser and then saving the bytes to disk as a file with a name based on the key name as a start. Cache retrieval would also need to periodically trigger maintenance to remove expired files from disk.