slimphp / Slim-HttpCache

Slim Framework HTTP cache middleware and service provider
MIT License
115 stars 25 forks source link

Truncating response body #55

Open JimTools opened 9 months ago

JimTools commented 9 months ago

truncating the body to reduce data transmission on cache hits.

closes #54

odan commented 4 months ago

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.

flavioheleno commented 4 months ago

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.