简体   繁体   中英

How do I improve my asp.net site when the Google speed test says “expiration not specified”?

I have taken different speed tests, including using Google's PageSpeed Insights . For every image on every page, it warned me that I should specify heights and widths on every image, but more importantly, it said " expiration not specified " after every image. It provided a link to suggestions on how to fix this, like use HTTP cache headers , but I didn't understand this at all. I have 47 pages, many of them have 10+ pictures on a page.

All the images are optimized, but since I'm on an asp.net website with 5 master pages, what can I do? I've seen solutions for php pages. I don't even know what "expiration not specified" means. Is there something I should just put in the head of my master pages, or do I need to do some type of coding on every image in my website? Any guidance in this regard would be greatly appreciated!

You need to change your IIS settings so that, when it's serving up your image files (or other, interesting, static content) it sets an appropriate cache expiry value.

This article starts poorly, tending to indicate that you need to pick a single fixed value for expiry and place it in a config file. But it later shows a screenshot:

在此输入图像描述

with some more hopeful looking options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM