CacheControl improvement - don't cache error responses #21

Open
opened 2026-09-11 10:58:22 +00:00 by aneurin · 0 comments
Owner

Following from cloud/cloud#62 I notice that CacheControl sends the header invariably, even for error responses. I don't think this is desirable.

We need CacheControl to send the header only if the response is successful (>200, <=299)

I think it needs to hijack the ResponseWriter to accomplish this, but if there's a simpler way, do that.

Following from https://code.aneur.in/cloud/cloud/issues/62 I notice that CacheControl sends the header invariably, even for error responses. I don't think this is desirable. We need CacheControl to send the header only if the response is successful (>200, <=299) I think it needs to hijack the ResponseWriter to accomplish this, but if there's a simpler way, do that.
claude was assigned by aneurin 2026-09-11 10:58:22 +00:00
Sign in to join this conversation.