Browse Source

SplitHTTP server: Add "Cache-Control: no-store" to GET response (#3652)

https://github.com/XTLS/Xray-core/pull/3652#issuecomment-2282308407
pull/3674/head
Lumière Élevé 3 months ago committed by GitHub
parent
commit
0c7303960a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      transport/internet/splithttp/hub.go

4
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")

Loading…
Cancel
Save