Cache control max-age = 1 day
This commit is contained in:
parent
8c6b0283e1
commit
b33cd06e70
2 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue