Question

I'm trying to find the best way to speed up the delivery of the static images that compose the design of an mvc site. The images are not gzipped, nor cached in the server or on the client (with content expire). Options are:

  1. Find why images are not cached and gzipped direcly from IIS6
  2. Write a specialized http handler
  3. Register a special route for static images and write a bynary actionresult method

What could be the best solution in terms of performance?

Was it helpful?

Solution

Best solution is to let IIS do it.

IIS6 Compression - most likely you need to specify file types to be compressed like .jpg, .png, .gif types, etc.

Caching will come from making sure that the correct headers are being sent to the client from code, and i believe there is a setting you can set in IIS that enables it for static content, but i'm not sure on that one.

OTHER TIPS

Surely the gain from gzipping most images is negligable since they're already compressed ?

Naybe you have some really badly compressed PNG files or something?

You might want to check out yahoo's performance advice site which includes some useful tips on optimizing images including links to utilities such as pngcrush.

its much better to use an image optimizing utility ONCE than to rely on IIS to compress them (possibly inefficiently) on the fly.

There's a nice library up on the MSDN Code Gallery that does this. It's called FastMVC.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top