diff --git a/src/express-http-server.js b/src/express-http-server.js index 3bcc8193..fd9e0fd2 100644 --- a/src/express-http-server.js +++ b/src/express-http-server.js @@ -30,6 +30,10 @@ class ExpressHTTPServer { this.beforeMiddleware(app); + if (this.cache) { + app.get('/*', this.buildCacheMiddleware()); + } + if (this.gzip) { this.app.use(require('compression')()); } @@ -39,10 +43,6 @@ class ExpressHTTPServer { app.use(basicAuth(username, password)); } - if (this.cache) { - app.get('/*', this.buildCacheMiddleware()); - } - if (this.distPath) { app.get('/', fastbootMiddleware); app.use(express.static(this.distPath));