caddyserver / caddyserver/cache-handler
Set-cookie header being cached
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 393
- Forks
- 28
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Description
In my testing I've found that set-cookie headers are getting cached by caddy. This is obviously a big problem for us and I've not been able to see any cache-handler config or ways to work around it in the caddy config.
Obviously in an ideal world we wouldn't be sending set-cookie headers on cacheable pages, but I'm working on a legacy platform and it's not going to be possible to change that behaviour in the short term, so I need caddy to handle it. We've been using caching in nginx for some time and not had this problem with nginx.
My preferred behaviour here would be that the initial cache-miss request would send the set-cookie headers, but it wouldn't be stored in the cache so future cache-hits would not receive it.
I'd really appreciate any help with this!
Contributor guide
No contributing guide indexed for this repository
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 reviewing the cache-handler's response caching behavior and reproduce the reported case with a response containing a set-cookie header. Trace how cache misses and hits handle that header. Done means the first response can include set-cookie while cached responses do not, with coverage for both paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100