Skip to content

Commit

Permalink
Move cache before gzip
Browse files Browse the repository at this point in the history
  • Loading branch information
Maros Hluska committed Aug 29, 2018
1 parent e498159 commit b30d01e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/express-http-server.js
Expand Up @@ -30,6 +30,10 @@ class ExpressHTTPServer {

this.beforeMiddleware(app);

if (this.cache) {
app.get('/*', this.buildCacheMiddleware());
}

if (this.gzip) {
this.app.use(require('compression')());
}
Expand All @@ -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));
Expand Down

0 comments on commit b30d01e

Please sign in to comment.