开发者

Caching to files (not memory) in ASP.NET

开发者 https://www.devze.com 2023-04-01 17:32 出处:网络
Is there any simle way how to save objects to files in selected directory? I have: Object (webservice response)

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

0

精彩评论

暂无评论...
验证码 换一张
取 消