Skip to content

Streaming and caching interact incorrectly when both are enabled #85

Description

@morcen

Problem

Two inconsistencies when a handler sets both passage_cache_ttl and passage_streaming:

  1. cacheManager->put() reads $response->body(), which buffers the stream before buildStreamedResponse() reads from the same PSR-7 body.
  2. A cache hit runs the getResponse() hook while the live streaming path skips the hook by design, so behavior differs between hit and miss.

Location

  • src/Http/Controllers/PassageController.php:110-143

Fix

Either make the two options mutually exclusive (throw at request time), or skip cache writes for streamed responses and skip the hook on cached streaming hits. Document the chosen rule.

Sizing

Priority 20 (Impact 2, Risk 3, Effort 2). Estimated half a day.

From the tech debt audit dated 2026-07-05.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtech-debtFrom the technical debt registerv3For versions v3.x

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions