Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use cache for minified assets.

  • Loading branch information...
commit 98f56b53b4f788e00daabf7b22d166cb48c2648e 1 parent 6a7a3ea
Chad Weider authored February 19, 2012

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. 11  node/server.js
11  node/server.js
@@ -142,10 +142,13 @@ async.waterfall([
142 142
       gracefulShutdown();
143 143
     });
144 144
     
145  
-    //serve static files
  145
+    // Cache both minified and static.
146 146
     var assetCache = new CachingMiddleware;
147  
-    app.all('/static/:filename(*)', assetCache.handle, minify.minify);
148  
-    
  147
+    app.all('/(minified|static)/*', assetCache.handle);
  148
+
  149
+    //serve static files
  150
+    app.all('/static/:filename(*)', minify.minify);
  151
+
149 152
     //serve minified files
150 153
     var jsServer = new (Yajsml.Server)({
151 154
       rootPath: 'minified/'
@@ -156,8 +159,6 @@ async.waterfall([
156 159
       Yajsml.associators.associationsForSimpleMapping(minify.tar);
157 160
     var associator = new StaticAssociator(associations);
158 161
     jsServer.setAssociator(associator);
159  
-    var assetCache_other = new CachingMiddleware;
160  
-    app.all('/minified/:filename', assetCache_other.handle);
161 162
     app.use(jsServer);
162 163
     
163 164
     //checks for padAccess

0 notes on commit 98f56b5

Please sign in to comment.
Something went wrong with that request. Please try again.