From b30d01eee40ce91c07588cd8731b6f70af84ae4e Mon Sep 17 00:00:00 2001 From: Maros Hluska Date: Wed, 29 Aug 2018 22:00:59 +0900 Subject: [PATCH] Move cache before gzip --- src/express-http-server.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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));