Dynamic image resizing has many advantages, the least of which is reduced disk space usage. However, it must be combined with a form of persistent caching, such as Amazon CloudFront or disk cache.
Dynamic image resizing gives you more flexibility on your website, while pre-generated image variations block you, preventing possible changes that you have to make. When combined with caching between them, there is no difference in performance at runtime.
The ImageResizer library offers disk caching, CloudFront caching, and proper memory and cache management . It is constantly being improved and maintained since 2007 and is bulletproof enough. He runs several social networking sites, and some have over a million images.
This is a time-tested, time-tested and module-checked library. It is also extremely easy to use - you just add ?width=x&height=y to the query string. Functionality can be added through 20+ plugins, so you will not be burdened with unused code and functions.
The article mentioned by CraigD is inherently limited in its performance by using HttpHandler instead of HttpModule, and HttpHandler cannot pass the request back to IIS source code for execution after the modified image is written to disk. It also incorrectly adjusts jpeg encoding or works well with ASP.NET cache or URL authorization system. Although, I must admit - compared to most of the sample code I saw, it breaks a much smaller number of resizing errors that I compiled .
I highly recommend using the ImageResizer library . This is good code, I wrote it :) If you end up using a sample code or writing your own, please avoid these pitfalls !
source share