Disk-based caching of dynamic images in IIS 7

Posted by Daniel Schierbeck on Stack Overflow See other posts from Stack Overflow or by Daniel Schierbeck
Published on 2010-04-29T10:03:40Z Indexed on 2010/04/29 10:07 UTC
Read the original article Hit count: 307

Filed under:
|
|
|
|

I'm writing an image server which needs to handle a relatively large number of concurrent requests (~5,000). The images being served are dynamically scaled down and cropped based on per-image specifications, which are queried from a database.

The number of images is rather large, so an in-memory cache isn't viable (thrashing would most definitely occur). I'm using native caching in IIS 7 to avoid hitting the ASP.NET app which generates the images on-the-fly.

I've looked around, but I couldn't find a simple way to configure IIS to store the cache on-disk -- is there such an option, or would I need to roll my own?

I'd rather avoid placing the generated images in a public folder, so they can be served statically, since I would prefer to invalidate the cache entries using a query parameter (last-edit time from the database,) which doesn't seem possible to reconcile with static caching.

I would love to get some feedback on this!

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about caching