Permalink
Browse files

Use cache for minified assets.

  • Loading branch information...
1 parent 6a7a3ea commit 98f56b53b4f788e00daabf7b22d166cb48c2648e @cweider committed Feb 20, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 node/server.js
View
@@ -142,10 +142,13 @@ async.waterfall([
gracefulShutdown();
});
- //serve static files
+ // Cache both minified and static.
var assetCache = new CachingMiddleware;
- app.all('/static/:filename(*)', assetCache.handle, minify.minify);
-
+ app.all('/(minified|static)/*', assetCache.handle);
+
+ //serve static files
+ app.all('/static/:filename(*)', minify.minify);
+
//serve minified files
var jsServer = new (Yajsml.Server)({
rootPath: 'minified/'
@@ -156,8 +159,6 @@ async.waterfall([
Yajsml.associators.associationsForSimpleMapping(minify.tar);
var associator = new StaticAssociator(associations);
jsServer.setAssociator(associator);
- var assetCache_other = new CachingMiddleware;
- app.all('/minified/:filename', assetCache_other.handle);
app.use(jsServer);
//checks for padAccess

0 comments on commit 98f56b5

Please sign in to comment.