Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to gzip and cache static images in Asp.net mvc

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?

like image 897
Ronnie Avatar asked Oct 24 '25 15:10

Ronnie


1 Answers

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.

like image 181
Darren Kopp Avatar answered Oct 26 '25 09:10

Darren Kopp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!