Permalink
Browse files

Added cachebusting rule to web.config, the cachebusting comment is ta…

…ken from the .htaccess
  • Loading branch information...
1 parent d8dd3c6 commit dd202e97db96fe8e3f4452432c30e77ca64e7261 @chaoaretasty chaoaretasty committed Apr 10, 2012
Showing with 30 additions and 10 deletions.
  1. +30 −10 iis/web.config
View
@@ -207,20 +207,22 @@
</customHeaders>
</httpProtocol>
- <!--
- Remove/force the WWW from the URL.
- Requires IIS Rewrite module http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/
- Configuration lifted from http://nayyeri.net/remove-www-prefix-from-urls-with-url-rewrite-module-for-iis-7-0
-
- ** Important Note
- using a non-www version of a webpage will set cookies for the whole domain making cookieless domains
- (eg. fast cdn-like access of static resources like css, js and images) impossible.
- # IMPORTANT: THERE ARE TWO RULES LISTED. NEVER USE BOTH RULES AT THE SAME TIME!
<rewrite>
<rules>
+ <!--
+ Remove/force the WWW from the URL.
+ Requires IIS Rewrite module http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/
+ Configuration lifted from http://nayyeri.net/remove-www-prefix-from-urls-with-url-rewrite-module-for-iis-7-0
+
+ ** Important Note
+ using a non-www version of a webpage will set cookies for the whole domain making cookieless domains
+ (eg. fast cdn-like access of static resources like css, js and images) impossible.
+
+ # IMPORTANT: THERE ARE TWO RULES LISTED. NEVER USE BOTH RULES AT THE SAME TIME!
+
<rule name="Remove WWW" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
@@ -235,9 +237,27 @@
</conditions>
<action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent" />
</rule>
+ -->
+ <!--
+ ----------------------------------------------------------------------
+ Built-in filename-based cache busting
+ ----------------------------------------------------------------------
+
+ If you're not using the build script to manage your filename version revving,
+ you might want to consider enabling this, which will route requests for
+ /css/style.v20110203.css to /css/style.css
+
+ To understand why this is important and a better idea than all.css?v1231,
+ read: github.com/h5bp/html5-boilerplate/wiki/Version-Control-with-Cachebusting
+
+ <rule name="Cachebusting">
+ <match url="^(.+)\.\d+(\.(js|css|png|jpg|gif)$)" />
+ <action type="Rewrite" url="{R:1}{R:2}" />
+ </rule>
+ -->
</rules>
</rewrite>
- -->
+
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

0 comments on commit dd202e9

Please sign in to comment.