简体   繁体   中英

Caching to files (not memory) in ASP.NET

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 http://www.4guysfromrolla.com/articles/061610-1.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM