Cache content ignored if no date present
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 505
- Forks
- 149
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 7
Description
https://github.com/ionrock/cachecontrol/blob/master/cachecontrol/controller.py#L120 ff. seems to be ignoring cache entries that do not have a date header.
I think https://tools.ietf.org/html/rfc7232#section-2.4 allows sending etag without date; in that case, the cache content would never be used.
Also, I'm wondering why it's deleting a cache entry here; if a cache entry does not have the headers required to make it useful, wouldn't it be better to never enter it into the cache in the first place?
(I may be misunderstanding things, grossly; I'm currently looking only at the code that retrieves data from the cache, in cached_response.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in cachecontrol/controller.py around line 120 and trace cached_response, focusing on responses with an ETag but no Date header. Check the relevant RFC 7232 behavior and existing cache tests before deciding the expected handling. Done means the issue’s cache-entry behavior is covered by a regression test and matches the agreed semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100