diff --git a/node/utils/caching_middleware.js b/node/utils/caching_middleware.js index f25059b882f..d99023e09d5 100644 --- a/node/utils/caching_middleware.js +++ b/node/utils/caching_middleware.js @@ -54,7 +54,7 @@ CachingMiddleware.prototype = new function () { var modifiedSince = (req.headers['if-modified-since'] && new Date(req.headers['if-modified-since'])); var lastModifiedCache = !error && stats.mtime; - if (lastModifiedCache) { + if (lastModifiedCache && responseCache[cacheKey]) { req.headers['if-modified-since'] = lastModifiedCache.toUTCString(); } else { delete req.headers['if-modified-since'];