From b33cd06e703ec8dba9ac9c55cbe425675b11a15b Mon Sep 17 00:00:00 2001 From: Tobe O Date: Mon, 2 Apr 2018 11:20:18 -0400 Subject: [PATCH] Cache control max-age = 1 day --- lib/src/cache.dart | 2 +- test/cache_test.dart | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/cache.dart b/lib/src/cache.dart index d048c67e..fdd2813f 100644 --- a/lib/src/cache.dart +++ b/lib/src/cache.dart @@ -143,7 +143,7 @@ class ResponseCache { var privacy = 'public'; res.headers - ..['cache-control'] = '$privacy, max-age=${timeout?.inSeconds ?? 0}' + ..['cache-control'] = '$privacy, max-age=${timeout?.inSeconds ?? Duration.secondsPerDay}' ..['last-modified'] = formatDateForHttp(modified); if (timeout != null) { diff --git a/test/cache_test.dart b/test/cache_test.dart index 3bda6e66..f463b0a8 100644 --- a/test/cache_test.dart +++ b/test/cache_test.dart @@ -83,6 +83,7 @@ main() async { test('sends 304 on if-modified-since', () async { var response = await client.get('/date.txt', headers: {'if-modified-since': formatDateForHttp(lastModified)}); + print('Response (${response.statusCode}): ${response.headers}'); expect(response.statusCode, 304); });