Safe Haskell | None |
---|---|
Language | Haskell2010 |
- cache :: RedisCacheBackend -> Middleware
- cacheNoBody :: RedisCacheBackend -> Middleware
- newCacheBackend :: ConnectInfo -> (Request -> ByteString -> IO Bool) -> (Request -> Response -> IO ()) -> (Request -> Response -> IO ()) -> IO RedisCacheBackend
- defaultCacheBackend :: IO RedisCacheBackend
- defaultConnectInfo :: ConnectInfo
- data ConnectInfo :: * = ConnInfo {}
- data PortID :: *
Documentation
cache :: RedisCacheBackend -> Middleware Source
cacheNoBody :: RedisCacheBackend -> Middleware Source
newCacheBackend :: ConnectInfo -> (Request -> ByteString -> IO Bool) -> (Request -> Response -> IO ()) -> (Request -> Response -> IO ()) -> IO RedisCacheBackend Source
defaultCacheBackend :: IO RedisCacheBackend Source
Cache Backend which cache all GET requests using local redis on standard port
You should use cacheNoBody
instead of cache
defaultConnectInfo :: ConnectInfo
Default information for connecting:
connectHost = "localhost" connectPort = PortNumber 6379 -- Redis default port connectAuth = Nothing -- No password connectDatabase = 0 -- SELECT database 0 connectMaxConnections = 50 -- Up to 50 connections connectMaxIdleTime = 30 -- Keep open for 30 seconds
data ConnectInfo :: *
Information for connnecting to a Redis server.
It is recommended to not use the ConnInfo
data constructor directly.
Instead use defaultConnectInfo
and update it with record syntax. For
example to connect to a password protected Redis server running on localhost
and listening to the default port:
myConnectInfo :: ConnectInfo myConnectInfo = defaultConnectInfo {connectAuth = Just "secret"}
ConnInfo | |
|