http: honor response headers in redirect caching

add a dictionary that maps "src_url" -> "expiry;dst_url", the dictionary
is checked before issuing an http request, and updated after getting a
3xx redirect response.

the cache expiry is determined according to the following (in desc
priority) -
1. Expires header
2. Cache-Control containing no-cache/no-store (disables caching)
3. Cache-Control s-maxage/max-age
4. Http codes 301/308 are cached indefinitely, other codes are not
   cached
This commit is contained in:
erankor 2022-01-10 21:44:27 +02:00 committed by Ronald S. Bultje
parent 641c4346b3
commit 625ea2d2a9