Do not set Last-Modifed to January 1st 1970 when cache buster ins layergroup token is 0. In this case, 0 means we don't know when the resource was updated for the last time.
This commit is contained in:
@@ -10,7 +10,9 @@ module.exports = function setLastModifiedHeader () {
|
||||
|
||||
if (cache_buster) {
|
||||
const cacheBuster = parseInt(cache_buster, 10);
|
||||
const lastModifiedDate = Number.isFinite(cacheBuster) ? new Date(cacheBuster) : new Date();
|
||||
const lastModifiedDate = Number.isFinite(cacheBuster) && cacheBuster !== 0
|
||||
? new Date(cacheBuster)
|
||||
: new Date();
|
||||
|
||||
res.set('Last-Modified', lastModifiedDate.toUTCString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user