diff --git a/CHANGELOG.md b/CHANGELOG.md index e079577..f1bb803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Update version bounds to support GHC 9.6 and servant 0.20 - Drop support for `jsForAPI` and the dependency on `servant-js` - Remove dependency on pipes, breaking change for `eventSource` function +- Add "Cache-Control: no-cache" to headers ## 0.2.1.0 -- 2021-04-21 diff --git a/src/Servant/API/EventStream.hs b/src/Servant/API/EventStream.hs index 1119d56..29908c0 100644 --- a/src/Servant/API/EventStream.hs +++ b/src/Servant/API/EventStream.hs @@ -73,7 +73,7 @@ type EventSource = SourceIO ServerEvent -- | This is mostly to guide reverse-proxies like -- -type EventSourceHdr = Headers '[Header "X-Accel-Buffering" Text] EventSource +type EventSourceHdr = Headers '[Header "X-Accel-Buffering" Text, Header "Cache-Control" Text] EventSource -- | See details at -- https://hackage.haskell.org/package/wai-extra-3.1.6/docs/Network-Wai-EventSource-EventStream.html#v:eventToBuilder @@ -81,4 +81,4 @@ instance MimeRender EventStream ServerEvent where mimeRender _ = maybe "" toLazyByteString . eventToBuilder eventSource :: EventSource -> EventSourceHdr -eventSource = addHeader @"X-Accel-Buffering" "no" \ No newline at end of file +eventSource = addHeader @"X-Accel-Buffering" "no" . addHeader @"Cache-Control" "no-cache" \ No newline at end of file