Update ifModifiedSince

This commit is contained in:
Tobe O 2018-04-01 21:27:56 -04:00
parent 4a8d9ee31e
commit 6a8183d646

View file

@ -27,9 +27,7 @@ class ResponseCache {
_cache.containsKey(req.uri.path)) { _cache.containsKey(req.uri.path)) {
var response = _cache[req.uri.path]; var response = _cache[req.uri.path];
// Only send a cached response if it is valid. if (response.timestamp.compareTo(modifiedSince) <= 0) {
if (timeout == null ||
modifiedSince.difference(response.timestamp) >= timeout) {
res.statusCode = 304; res.statusCode = 304;
return false; return false;
} }