Use cache for minified assets.

pull/468/head
Chad Weider 2012-02-19 18:37:31 -08:00
parent 6a7a3ea3ab
commit 98f56b53b4
1 changed files with 6 additions and 5 deletions

View File

@ -142,9 +142,12 @@ async.waterfall([
gracefulShutdown(); gracefulShutdown();
}); });
//serve static files // Cache both minified and static.
var assetCache = new CachingMiddleware; 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 //serve minified files
var jsServer = new (Yajsml.Server)({ var jsServer = new (Yajsml.Server)({
@ -156,8 +159,6 @@ async.waterfall([
Yajsml.associators.associationsForSimpleMapping(minify.tar); Yajsml.associators.associationsForSimpleMapping(minify.tar);
var associator = new StaticAssociator(associations); var associator = new StaticAssociator(associations);
jsServer.setAssociator(associator); jsServer.setAssociator(associator);
var assetCache_other = new CachingMiddleware;
app.all('/minified/:filename', assetCache_other.handle);
app.use(jsServer); app.use(jsServer);
//checks for padAccess //checks for padAccess