diff --git a/wai-app-static/ChangeLog.md b/wai-app-static/ChangeLog.md index 295b1587a..1ce83f47e 100644 --- a/wai-app-static/ChangeLog.md +++ b/wai-app-static/ChangeLog.md @@ -1,5 +1,9 @@ # wai-app-static changelog +## 3.1.9 + +* Added `NoCache` constructor to `MaxAge` [#977](https://github.com/yesodweb/wai/pull/977) + ## 3.1.8 * Added `NoStore` constructor to `MaxAge` [#938](https://github.com/yesodweb/wai/pull/938) diff --git a/wai-app-static/Network/Wai/Application/Static.hs b/wai-app-static/Network/Wai/Application/Static.hs index 86573e460..401f43e01 100644 --- a/wai-app-static/Network/Wai/Application/Static.hs +++ b/wai-app-static/Network/Wai/Application/Static.hs @@ -233,12 +233,14 @@ cacheControl maxage = MaxAgeSeconds i -> (:) ("Cache-Control", maxAgeValue i) MaxAgeForever -> (:) ("Cache-Control", maxAgeValue oneYear) NoStore -> (:) ("Cache-Control", "no-store") + NoCache -> (:) ("Cache-Control", "no-cache") headerExpires = case maxage of NoMaxAge -> id MaxAgeSeconds _ -> id -- FIXME MaxAgeForever -> (:) ("Expires", "Thu, 31 Dec 2037 23:55:55 GMT") NoStore -> id + NoCache -> id -- | Turn a @StaticSettings@ into a WAI application. staticApp :: StaticSettings -> W.Application diff --git a/wai-app-static/WaiAppStatic/Types.hs b/wai-app-static/WaiAppStatic/Types.hs index bfbed6088..183466858 100644 --- a/wai-app-static/WaiAppStatic/Types.hs +++ b/wai-app-static/WaiAppStatic/Types.hs @@ -76,6 +76,8 @@ data MaxAge MaxAgeForever | -- | set cache-control to no-store @since 3.1.8 NoStore + | -- | set cache-control to no-cache @since 3.1.9 + NoCache -- | Just the name of a folder. type FolderName = Piece diff --git a/wai-app-static/wai-app-static.cabal b/wai-app-static/wai-app-static.cabal index bd92648b5..f9319e44a 100644 --- a/wai-app-static/wai-app-static.cabal +++ b/wai-app-static/wai-app-static.cabal @@ -1,5 +1,5 @@ name: wai-app-static -version: 3.1.8 +version: 3.1.9 license: MIT license-file: LICENSE author: Michael Snoyman