Extarct setCacheChannelHeader middleware from controller's context
This commit is contained in:
@@ -56,7 +56,7 @@ NamedMapsController.prototype.register = function(app) {
|
||||
getAffectedTables(),
|
||||
getTile(tileOptions),
|
||||
this.setSurrogateKey(),
|
||||
this.setCacheChannelHeader(),
|
||||
setCacheChannelHeader(),
|
||||
this.setLastModifiedHeader(),
|
||||
this.setCacheControlHeader(),
|
||||
this.setContentTypeHeader(),
|
||||
@@ -85,7 +85,7 @@ NamedMapsController.prototype.register = function(app) {
|
||||
getImage(staticOptions),
|
||||
incrementMapViews({ metadataBackend: this.metadataBackend }),
|
||||
this.setSurrogateKey(),
|
||||
this.setCacheChannelHeader(),
|
||||
setCacheChannelHeader(),
|
||||
this.setLastModifiedHeader(),
|
||||
this.setCacheControlHeader(),
|
||||
this.setContentTypeHeader(),
|
||||
@@ -419,7 +419,7 @@ function templateBounds(view) {
|
||||
return false;
|
||||
}
|
||||
|
||||
NamedMapsController.prototype.setCacheChannelHeader = function () {
|
||||
function setCacheChannelHeader () {
|
||||
return function setCacheChannelHeaderMiddleware (req, res, next) {
|
||||
const { affectedTablesAndLastUpdate } = res.locals;
|
||||
|
||||
@@ -429,7 +429,7 @@ NamedMapsController.prototype.setCacheChannelHeader = function () {
|
||||
|
||||
next();
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
NamedMapsController.prototype.setSurrogateKey = function () {
|
||||
return function setSurrogateKeyMiddleware(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user