Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.Wai.Middleware.RedisCache
Contents
Synopsis
- 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 connectTimeout = Nothing -- Don't add timeout logic connectTLSParams = Nothing -- Do not use TLS
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"}
Constructors
ConnInfo | |
Fields
|
Instances
Show ConnectInfo | |
Defined in Database.Redis.Connection Methods showsPrec :: Int -> ConnectInfo -> ShowS # show :: ConnectInfo -> String # showList :: [ConnectInfo] -> ShowS # |
Constructors
PortNumber PortNumber | |
UnixSocket String |