Safe Haskell | None |
---|
Redis backend for Network.Wai.Middleware.Cache.
This backend uses Database.Redis.Pile for low-lewel operations. Main drawback of this backend is the fact that whole response will be consumed in memory.
cache (redisBackend -- use defaults, DB 0 and "myprefix" R.defaultConnectInfo 0 "myprefix" -- prefix for caching Nothing -- no expiration ["mytag"] -- one cache tag (rawPathInfo) -- URL path as key lookupETag -- And find "If-None-Match" ) app -- our app
- redisBackend :: ConnectInfo -> Integer -> ByteString -> Integer -> [ByteString] -> (Request -> ByteString) -> (Request -> Maybe ByteString) -> CacheBackend
Cache backend
:: ConnectInfo | Redis connection info. |
-> Integer | Redis DB Index. |
-> ByteString | Cache prefix for key and tags. See Database.Redis.Pile for details. |
-> Integer | Cache TTL. Use |
-> [ByteString] | Cache Tags. See Database.Redis.Pile for details. |
-> (Request -> ByteString) | Cache key extraction function. |
-> (Request -> Maybe ByteString) |
|
-> CacheBackend |
Redis backend for Network.Wai.Middleware.Cache.