lostisland / lostisland/faraday_middleware
Server Rack::Cache + Faraday Rack::Cache, cache doesn't expire
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 558
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
Now that I have server rack-cache and faraday rack-cache working together, I've found another issue: nothing expires from the cache. I'm having trouble narrowing in on the exact error - but it seems related to the faraday :net_http adapter. First I was getting a NoMethodError due to nil values in env[:request_headers], then, with a fix for that in rack_compatible, I get caching that refuses to expire.
Test case:
https://github.com/therabidbanana/faraday_middleware/commit/621d92972216988924162dac7b0c278b508d3701
Changing to :em_http has allowed me to work around the problem, but I can't hunt down the exact reason why.
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 by reproducing the test case in commit 621d92972216988924162dac7b0c278b508d3701 and compare the :net_http and :em_http adapter paths when used with Server Rack::Cache and Faraday Rack::Cache. Trace the request headers and cache-expiration behavior, then confirm that cached responses expire with :net_http without the nil-header failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100