{"id":452,"date":"2014-07-11T08:30:06","date_gmt":"2014-07-11T08:30:06","guid":{"rendered":"http:\/\/samwebman.wordpress.com\/?p=452"},"modified":"2014-07-11T08:30:06","modified_gmt":"2014-07-11T08:30:06","slug":"enable-caching-in-iis-to-speed-performance","status":"publish","type":"post","link":"https:\/\/www.intentrust.com\/?p=452","title":{"rendered":"Enable Caching in IIS to Speed Performance"},"content":{"rendered":"<pre class=\"title\">Reference from: http:\/\/bradkingsley.com\/enable-caching-in-iis-to-speed-performance\/<\/pre>\n<h2 class=\"title\">Enable Caching in IIS to Speed Performance<\/h2>\n<div class=\"post-info-top\"><span class=\"post-info-date\"> Posted by <a title=\"View all posts by Brad Kingsley\" href=\"http:\/\/bradkingsley.com\/author\/sbradk\/\" rel=\"author\">Brad Kingsley<\/a> on April 17, 2012 <\/span><\/div>\n<p>Google\u2019s various page speed testing tools seem to prefer browser caching set with at least a one week expiration set. That makes great sense to me! Setting a browser cache expiration tells the visitor\u2019s browser that is is okay to cache the content \u2013 so upon the next visit the browser will load the content from local cache rather than requesting it from the server again. That\u2019s a big win on a couple different fronts:<\/p>\n<p>1. Page Load Speed. If the page, or at least parts of the page, are loaded from cache, that is always going to display faster than a round-trip to the server. And the faster the visitor\u2019s browsing experience is, the better the overall experience and site impression will be. Site load time has shown to have a large impact on visitor interaction with web sites.<\/p>\n<p>2. Bandwidth \/ Data Transfers. If the data is pulled from cache rather than the server, that obviously means less data being transferred. In a case where bandwidth is tracked and allocated on a monthly data transfer plan, this means less overall usage and potentially less costs for your hosting. This would be especially important in sites that are image-heavy like perhaps storefronts that show images of varying size and quality for their products.<\/p>\n<p>3. Site \/ Server performance. If something is loaded from cache rather than from the server, that cuts down on the number of requests that the site needs to satisfy. Sure, even the smallest of servers can commonly handle hundreds if not thousands of concurrent visitors, but hey, why make it do all that work if it doesn\u2019t need to? Imagine if your content is all cached and you have a 50% new vs returning visitor ratio\u2026 that means that your site load would potentially be cut in half, and the server could handle twice as many visitors before needing a resource upgrade. Score!<\/p>\n<p>OK. Are you sold on the idea yet? If so, here\u2019s how to adjust this setting in IIS 7.5 (Windows Server 2008 R2 hosting)\u2026<\/p>\n<p>First open the IIS Manager on your server, expand the Sites folder and then find the site you want to manage. You can control the caching either for the entire site or for specific folders. The interface and steps are basically the same, but I\u2019ll show screenshots of making the change just on the \\images\\ folder of my test site:<\/p>\n<p><a href=\"http:\/\/bradkingsley.com\/wp-content\/uploads\/2012\/04\/IISCompression1.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-898\" title=\"IISCompression1\" src=\"http:\/\/bradkingsley.com\/wp-content\/uploads\/2012\/04\/IISCompression1.png\" alt=\"Compression setting in IIS\" width=\"600\" height=\"426\" \/><\/a><\/p>\n<p>Once you select the folder you\u2019ll see a bunch of standard option icons. You want to look for the HTTP Response Headers icon in the IIS section of the IIS Manager interface. I\u2019ve highlighted it in red above.<\/p>\n<p>Once you double-click on that icon you\u2019ll see the interface change:<\/p>\n<p><a href=\"http:\/\/bradkingsley.com\/wp-content\/uploads\/2012\/04\/IISCompression2.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-899\" title=\"IISCompression2\" src=\"http:\/\/bradkingsley.com\/wp-content\/uploads\/2012\/04\/IISCompression2.png\" alt=\"Set Common Headers in IIS\" width=\"600\" height=\"427\" \/><\/a><\/p>\n<p>From this interface you\u2019ll want to select the option in the right-hand pane to Set Common Headers. Clicking that link brings up a dialog box to set just two common header items with a few option settings:<\/p>\n<p><a href=\"http:\/\/bradkingsley.com\/wp-content\/uploads\/2012\/04\/IISCompression3.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-900\" title=\"IISCompression3\" src=\"http:\/\/bradkingsley.com\/wp-content\/uploads\/2012\/04\/IISCompression3.png\" alt=\"The Common Header settings and options in IIS\" width=\"402\" height=\"249\" \/><\/a><\/p>\n<p>The HTTP Keep-alive should be already selected by default \u2013 leave that alone. Let\u2019s pay attention to the Expire Web Content option which <em>isn\u2019t<\/em> selected by default. Once you check that box you\u2019ll see that it defaults to expiring the content immediately\u2026 which is not helpful at all. Choose the radio button for \u201cAfter\u201d then set a date range. Google seems to prefer this caching option set to at least one week so I commonly set it to 8 days as shown in my sample image.<\/p>\n<p>Click OK to save the settings and you\u2019re all done! You can test your site using browser (IE or Chrome) developer tools to confirm the headers, or use an external testing site to confirm the caching.<\/p>\n<p>I hope you find this helpful \u2013 Happy Hosting!<br \/>\n<a href=\"https:\/\/plus.google.com\/116050514307362611282?rel=author\">Brad on Google+<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reference from: http:\/\/bradkingsley.com\/enable-caching- &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.intentrust.com\/?p=452\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008Enable Caching in IIS to Speed Performance\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[79],"_links":{"self":[{"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/posts\/452"}],"collection":[{"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=452"}],"version-history":[{"count":0,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/posts\/452\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.intentrust.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}