To install Cache-Control, you must specify it yourself. You can either do this in web.config, IIS Manager for selected folders (static, images ...) or install it in code. The HTTP 1.1 standard recommends in the future as the maximum validity period.
Setting future expiration dates is considered good practice for all static content on your site. Not having If-Modified-Since
results in the headers, which may require longer than the first time queries for small static files. These calls use the ETag header.
When you have Cache-Control: max-age=315360000
, the main HTTP responses exceed the number of If-Modified-Since>
calls, and because of this, it is good to remove the ETag header and result in smaller response headers for static files. IIS has no settings for this, so you need to do response.Headers.Remove("ETag");
in OnPreServerRequestHeaders()
And if you want to optimize your headers further, you can remove X-Powered-By:ASP.NET
in the IIS settings and the X-Aspnet-Version
header (although I don't see in your answer) in web.config - enableVersionHeader="false"
in system.web / httpRuntime element.
For more advice, I offer an excellent book - http://www.amazon.com/Ultra-Fast-ASP-NET-Build-Ultra-Scalable- Server / dp / 1430223839
source share