From 0c7303960abbce75d9561148021a29e6a5c222ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lumi=C3=A8re=20=C3=89lev=C3=A9?= <88174309+PoneyClairDeLune@users.noreply.github.com> Date: Sun, 11 Aug 2024 00:59:42 +0100 Subject: [PATCH] SplitHTTP server: Add "Cache-Control: no-store" to GET response (#3652) https://github.com/XTLS/Xray-core/pull/3652#issuecomment-2282308407 --- transport/internet/splithttp/hub.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/transport/internet/splithttp/hub.go b/transport/internet/splithttp/hub.go index 88acbcd3..9fdd15b4 100644 --- a/transport/internet/splithttp/hub.go +++ b/transport/internet/splithttp/hub.go @@ -184,6 +184,10 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req // magic header instructs nginx + apache to not buffer response body writer.Header().Set("X-Accel-Buffering", "no") + // A web-compliant header telling all middleboxes to disable caching. + // Should be able to prevent overloading the cache, or stop CDNs from + // teeing the response stream into their cache, causing slowdowns. + writer.Header().Set("Cache-Control", "no-store") if !h.config.NoSSEHeader { // magic header to make the HTTP middle box consider this as SSE to disable buffer writer.Header().Set("Content-Type", "text/event-stream")