X-Git-Url: https://git.squeep.com/?p=websub-hub;a=blobdiff_plain;f=src%2Fmanager.js;h=b5eff7a3ecb88698beeb9d4bcc9364f4ccedacb7;hp=65444a064c33e202afa195208236cab0527f3bab;hb=06565fb4b802c38a60d4c6e0f4b65c26da18d69f;hpb=83c6ed3b2e4065ee1cab4a1084daaf43a50ec5ff diff --git a/src/manager.js b/src/manager.js index 65444a0..b5eff7a 100644 --- a/src/manager.js +++ b/src/manager.js @@ -25,13 +25,6 @@ class Manager { this.db = db; this.options = options; this.communication = new Communication(logger, db, options); - - // Precalculate the invariant root GET metadata. - this.getRootContent = Template.rootHTML(undefined, options); - const now = new Date(); - this.startTimeString = now.toGMTString(); - this.startTimeMs = now.getTime(); - this.getRootETag = common.generateETag(undefined, undefined, this.getRootContent); } @@ -61,16 +54,8 @@ class Manager { const _scope = _fileScope('getRoot'); this.logger.debug(_scope, 'called', { ctx }); - res.setHeader(Enum.Header.LastModified, this.startTimeString); - res.setHeader(Enum.Header.ETag, this.getRootETag); - - if (common.isClientCached(req, this.startTimeMs, this.getRootETag)) { - this.logger.debug(_scope, 'client cached response', { ctx }); - res.statusCode = 304; - res.end(); - return; - } - res.end(this.getRootContent); + const content = Template.rootHTML(ctx, this.options); + res.end(content); this.logger.info(_scope, 'finished', { ctx }); }