on master help sign in
Turn off FD cache by default #371
commitde64974b0ec4fbb913721ea109038290c7ce7499 authorMichael Snoyman <michael@snoyman.com> dateMon 4 May 2015, 16:28 (11 years ago) parentffcad4a
4 files changed+16−4
warp/ChangeLog.md+4 warp/Network/Wai/Handler/Warp.hs+9−1 warp/Network/Wai/Handler/Warp/Settings.hs+2−2 warp/warp.cabal+1−1
warp/ChangeLog.md+4
@@ -1,3 +1,7 @@
1+## 3.0.13
2+
3+* Turn off file descriptor cache by default [#371](https://github.com/yesodweb/wai/issues/371)
4+
15## 3.0.12.1
26
37* Fix for: HEAD requests returning non-empty entity body [#369](https://github.com/yesodweb/wai/issues/369)
warp/Network/Wai/Handler/Warp.hs+9−1
@@ -184,7 +184,15 @@ setTimeout x y = y { settingsTimeout = x }
184184setManager :: Manager -> Settings -> Settings
185185setManager x y = y { settingsManager = Just x }
186186
187−-- | Cache duration time of file descriptors in seconds. 0 means that the cache mechanism is not used. Default value: 10
187+-- | Cache duration time of file descriptors in seconds. 0 means that the cache mechanism is not used.
188+--
189+-- The FD cache is an optimization that is useful for servers dealing with
190+-- static files. However, if files are being modified, it can cause incorrect
191+-- results in some cases. Therefore, we disable it by default. If you know that
192+-- your files will be static, it's recommended to turn this on; a reasonable
193+-- value for those cases is 10.
194+--
195+-- Default value: since 3.0.13, default value is 0, was previously 10
188196setFdCacheDuration :: Int -> Settings -> Settings
189197setFdCacheDuration x y = y { settingsFdCacheDuration = x }
190198
warp/Network/Wai/Handler/Warp/Settings.hs+2−2
@@ -45,7 +45,7 @@ data Settings = Settings
4545 , settingsOnClose :: SockAddr -> IO () -- ^ What to do when a connection is close. Default: do nothing.
4646 , settingsTimeout :: Int -- ^ Timeout value in seconds. Default value: 30
4747 , settingsManager :: Maybe Manager -- ^ Use an existing timeout manager instead of spawning a new one. If used, 'settingsTimeout' is ignored. Default is 'Nothing'
48− , settingsFdCacheDuration :: Int -- ^ Cache duratoin time of file descriptors in seconds. 0 means that the cache mechanism is not used. Default value: 10
48+ , settingsFdCacheDuration :: Int -- ^ Cache duratoin time of file descriptors in seconds. 0 means that the cache mechanism is not used. Default value: 0
4949 , settingsBeforeMainLoop :: IO ()
5050 -- ^ Code to run after the listening socket is ready but before entering
5151 -- the main event loop. Useful for signaling to tests that they can start
@@ -108,7 +108,7 @@ defaultSettings = Settings
108108 , settingsOnClose = const $ return ()
109109 , settingsTimeout = 30
110110 , settingsManager = Nothing
111− , settingsFdCacheDuration = 10
111+ , settingsFdCacheDuration = 0
112112 , settingsBeforeMainLoop = return ()
113113 , settingsFork = void . forkIOWithUnmask
114114 , settingsNoParsePath = False
warp/warp.cabal+1−1
@@ -1,5 +1,5 @@
11Name: warp
2−Version: 3.0.12.1
2+Version: 3.0.13
33Synopsis: A fast, light-weight web server for WAI applications.
44License: MIT
55License-file: LICENSE