Slim-HttpCache icon indicating copy to clipboard operation
Slim-HttpCache copied to clipboard

Truncating response body

Open JimTools opened this issue 1 year ago • 2 comments

truncating the body to reduce data transmission on cache hits.

closes #54

JimTools avatar Mar 07 '24 14:03 JimTools

I've been thinking about this approach. Wouldn't it be easier to implement a custom middleware that checks the response for status code 304 and, if the case, returns a response with an empty body. The advantage would be that this can be added when needed and doesn't break the existing logic.

odan avatar Jul 09 '24 10:07 odan

Honestly, dropping the body is something that I'd expect from this middleware and not have to add another one to handle it. IMHO, the current behavior/logic is broken.

flavioheleno avatar Jul 09 '24 22:07 flavioheleno

I've updated to make the StreamFactory optional which keeps BC with current implementations. Also merged in the latest 1.x branch.

akrabat avatar Nov 02 '25 16:11 akrabat