by   January 28 2015   
Caching is so important you really need to focus one full day on just this. Like many other developers I often focus on the speed after I have the content while the reverse would be much better for indexing in search engines. If you're an IIS owner than you're in luck, so am I. (I do also run Apache Tomcat and others but this article is about IIS Caching. Let's get to it and learn how to setup your cache per folder.

How to Cache the CSS, JS files

You just tested your website and found that you need to increase the cache time of your CSS or JS files. 

I know my new Bootstrap templates are really big, so big caching is priority number one. 

Here's a great read after you finish here. 

Caching specific Javascript and CSS files

You should make sure your GZip is setup and working correctly. 

Check it and read the article here if you are not sure. IIS 7.x Cache GZip Windows IIS Server 2008 +

Here's my IIS individual site (www.truckandtools.com) setup.
.css
.js

I have most all my templates under one main folder.
It might be themes/ or scripts/ or assets/
I set the cache to the main folder so if anything is mixed within the folder it still is handled correctly.

ignore my cdn. setup, that's only to fool YSlow and to measure bandwidth used by the templates.

Scoring on http://gtmetrix.com/ took it from 80 to 92 by adding cache to a single folder that holds the templates.

Let's recap: 

Navigation from your IIS Manager to the website > folder you want to have files cached from. 

If you need to cache everything you can do this on from the main folder but it's best that you control your site and manage what you cache so I suggest you cache per folder. 

Setup your themes and templates into one folder then cache every fold type that YSlow and GTMetrix recommends. Then you can add others but get the basics first. 

If you have any questions ask me on my Google +

Here's my newest configuration setup after testing I feel in my system this is well balanced. (http://www.webpagetest.org , http://gtmetrix.com/)

<urlCompression doStaticCompression="true" doDynamicCompression="true" />
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
<remove fileExtension=".js" />
<mimeMap fileExtension=".js" mimeType="text/javascript" />
<remove fileExtension=".css" />
<mimeMap fileExtension=".css" mimeType="text/css" />
</staticContent>

IIS_7_CACHE_FOLDER_FILES

Caching is so important you really need to focus one full day on just this. Like many other developers I often focus on the speed after I have the content while the reverse would be much better for indexing in search engines. If you're an IIS owner than you're in luck, so am I. (I do also run Apache Tomcat and others but this article is about IIS Caching. Let's get to it and learn how to setup your cache per folder.