Developing ASP.NET MVC Web Applications — Question 108
You are developing an application that uses many small images.
When the images load, the application runs slowly.
You need to improve the performance of the application.
What should you do?
Answer options
- A. Preload all the images when the application starts to ensure that the images are cached.
- B. Convert the images to ICO file format and stream all images on a single connection.
- C. Host all images on a Microsoft Azure web role with multiple instances.
- D. Combine all the images into a single image and use CSS to create sprites.
Correct answer: D
Explanation
The correct answer is D, as combining images into a single sprite reduces the number of HTTP requests, significantly improving loading times. Option A may preload images but does not address the underlying performance issue. Option B is not effective since ICO format may not be suitable for all image types and streaming on a single connection does not optimize loading. Option C, while potentially beneficial for scalability, does not directly solve the performance issue related to image loading.