Developing ASP.NET MVC Web Applications — Question 14
You are developing an application that uses many small images for various aspects of the interface.
The application responds slowly when additional resources are being accessed.
You need to improve the performance of the application.
What should you do?
Answer options
- A. Preload all the images when the client connects to ensure that the images are cached.
- B. Combine all the images into a single image and use CSS to create sprites.
- C. Host all images on an alternate server and provide a CDN. [1]
Correct answer: C
Explanation
The correct answer is C because hosting images on a CDN can significantly reduce load times and improve performance by distributing the content closer to users. Option A may cause initial delays due to the amount of data being loaded upfront, while option B, although useful for reducing HTTP requests, does not address the distribution and speed benefits that a CDN provides.