API endpoint /vault/directory/<dirhash>/ should not be cached by varnish
At very least, because this looks weird:
$ http https://archive.softwareheritage.org/api/1/vault/directory/f557a108b5878c7d7a46e94f538d6bb65379e62e/
HTTP/1.1 404 Not Found
Age: 0
Allow: POST, GET, OPTIONS
Connection: keep-alive
Content-Length: 123
Content-Type: application/json
Date: Wed, 25 Nov 2020 08:55:53 GMT
Server: gunicorn/19.9.0
Strict-Transport-Security: max-age=15768000;
Vary: Accept,Cookie
Via: 1.1 archive.softwareheritage.org
Via: 1.1 varnish (Varnish/6.1)
X-Frame-Options: SAMEORIGIN
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1606294554
X-Varnish: 213079
{
"exception": "NotFoundExc",
"reason": "Cooking of directory 'f557a108b5878c7d7a46e94f538d6bb65379e62e' was never requested."
}
$ http POST https://archive.softwareheritage.org/api/1/vault/directory/f557a108b5878c7d7a46e94f538d6bb65379e62e/
HTTP/1.1 200 OK
[...]
$ http https://archive.softwareheritage.org/api/1/vault/directory/f557a108b5878c7d7a46e94f538d6bb65379e62e/
HTTP/1.1 404 Not Found
Age: 99
Allow: POST, GET, OPTIONS
Connection: keep-alive
Content-Length: 123
Content-Type: application/json
Date: Wed, 25 Nov 2020 08:55:53 GMT
Server: gunicorn/19.9.0
Strict-Transport-Security: max-age=15768000;
Vary: Accept,Cookie
Via: 1.1 archive.softwareheritage.org
Via: 1.1 varnish (Varnish/6.1)
X-Frame-Options: SAMEORIGIN
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1606294554
X-Varnish: 1515525 213080
{
"exception": "NotFoundExc",
"reason": "Cooking of directory 'f557a108b5878c7d7a46e94f538d6bb65379e62e' was never requested."
}
Migrated from T2810 (view on Phabricator)