Skip to content

Regression: ATS 9.0.x served cached objects with a negative CC: max-age #7254

@zwoop

Description

@zwoop

This is. regression from 8.1.x -> 9.0.x, but essentially, we serve a response from cache, with a negative max-age, using the heuristics settings. This is not allowed by the RFC, and detected by the cache-tests suites.

First request (cache miss, notice the response with CC: max-age=-3600)

+++++++++ Incoming Request +++++++++
-- State Machine Id: 1
GET http:///test/a2cf83d1-7e1f-4027-acb3-5b3bbb406d82 HTTP/1.1
Pragma: foo
Cache-Control: nothing-to-see-here
Test-Name: HTTP cache must not reuse a response with negative `Cache-Control: max-age`
Test-ID: freshness-max-age-negative
Req-Num: 1
Accept: */*
User-Agent: node-fetch/1.0 (+https://github.com/bitinn/node-fetch)
Accept-Encoding: gzip,deflate
Connection: close
Host: 127.0.0.1:8080

+++++++++ Incoming O.S. Response +++++++++
-- State Machine Id: 1
HTTP/1.1 200 OK
Server-Base-Url: /test/a2cf83d1-7e1f-4027-acb3-5b3bbb406d82
Server-Request-Count: 1
Client-Request-Count: 1
Server-Now: 1602172057000
Capability-Seen:
Cache-Control: max-age=-3600
Content-Type: text/plain
Request-Numbers: 1
Date: Thu, 08 Oct 2020 15:47:36 GMT
Connection: keep-alive
Content-Length: 36

Second request, now served out of cache:

+++++++++ Incoming Request +++++++++
-- State Machine Id: 2
GET http:///test/a2cf83d1-7e1f-4027-acb3-5b3bbb406d82 HTTP/1.1
Pragma: foo
Cache-Control: nothing-to-see-here
Test-Name: HTTP cache must not reuse a response with negative `Cache-Control: max-age`
Test-ID: freshness-max-age-negative
Req-Num: 2
Accept: */*
User-Agent: node-fetch/1.0 (+https://github.com/bitinn/node-fetch)
Accept-Encoding: gzip,deflate
Connection: close
Host: 127.0.0.1:8080

-- State Machine Id: 2
HTTP/1.1 200 OK
Server-Base-Url: /test/a2cf83d1-7e1f-4027-acb3-5b3bbb406d82
Server-Request-Count: 1
Client-Request-Count: 1
Server-Now: 1602172057000
Capability-Seen:
Cache-Control: max-age=-3600
Content-Type: text/plain
Request-Numbers: 1
Date: Thu, 08 Oct 2020 15:47:36 GMT
Content-Length: 36
Age: 5
Connection: close
Server: ATS/9.0.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions