Is there any simle way how to save objects to files in selected directory?
I have:
- Object (webservice response)
- Id (md5 hash)
- Cache life time (6 days)
- Folder (where to save files)
I开发者_运维技巧 need: some solution, where I can
- set cache directory
- set hierarchical directory level (all files cannot be in one directory, there can be thousands of files)
- add (rewrite expired file) / get object to / from cache
- thread safety
.Net has the ability to create custom cache providers.
I have seen articles on how to create a disk based one.
here is a link on creating a mongodb based one. Dependent on your experience level that may be enough to see you through. http://msdn.microsoft.com/en-us/magazine/gg650661.aspx
I'll see if I can find the article about the disk based one.
found it https://web.archive.org/web/20211020121627/https://www.4guysfromrolla.com/articles/061610-1.aspx
精彩评论