I am using IIS 6 and IIS 7 as a web server.
After running Google page speed online , it remarks that I should be: Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
And it lists a lot of plain images , my javascript files and the style sheets.
How can I set this expiry date for these static files ? I thought this was done automatically by the browser ?
Configure Output Caching Through the IIS ManagerFrom the Start menu, click Administrative Tools, and then click Internet Information Services (IIS) Manager. In the tree view on the left side, find your application. Select the Output Caching menu item. In the right column, click Add in the Action menu.
The <clientCache> element of the <staticContent> element specifies cache-related HTTP headers that IIS 7 and later sends to Web clients, which control how Web clients and proxy servers will cache the content that IIS 7 and later returns.
Leverage browser caching:
Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching
To set an expiry date or a maximum age in the HTTP headers for static resources
Open IIS manager-> Click your site-> Click the HTTP Response Headers in the home page-> Click the Set Common Headers on the Actions panel -> Check Expire Web Content -> Set After 7 days (as suggested for in the page speed analysis "Specify an expiration at least one week in the future for the following resources"
http://technet.microsoft.com/en-us/library/cc770661%28WS.10%29.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With