@@ -21,17 +21,27 @@ module.exports = function(app) {
2121 var env = app . get ( 'env' ) ;
2222
2323 if ( 'development' === env ) {
24- app . use ( require ( 'connect-livereload' ) ( ) ) ;
24+ // app.use(require('connect-livereload')());
2525
26- // Disable caching of scripts for easier testing
27- app . use ( function noCache ( req , res , next ) {
28- if ( req . url . indexOf ( '/scripts/' ) === 0 ) {
29- res . header ( 'Cache-Control' , 'no-cache, no-store, must-revalidate' ) ;
30- res . header ( 'Pragma' , 'no-cache' ) ;
31- res . header ( 'Expires' , 0 ) ;
26+ app . use ( compression ( {
27+ filter : function ( req , res ) {
28+ if ( req . headers [ 'x-no-compression' ] ) {
29+ return false ;
30+ }
31+
32+ return true ;
3233 }
33- next ( ) ;
34- } ) ;
34+ } ) ) ;
35+
36+ // Disable caching of scripts for easier testing
37+ // app.use(function noCache(req, res, next) {
38+ // if (req.url.indexOf('/scripts/') === 0) {
39+ // res.header('Cache-Control', 'no-cache, no-store, must-revalidate');
40+ // res.header('Pragma', 'no-cache');
41+ // res.header('Expires', 0);
42+ // }
43+ // next();
44+ // });
3545
3646 app . use ( express . static ( path . join ( config . root , '.tmp' ) ) ) ;
3747 app . use ( express . static ( path . join ( config . root , 'app' ) ) ) ;
0 commit comments