Wheb-0.3.0.0: The frictionless WAI Framework

Safe HaskellNone
LanguageHaskell2010

Web.Wheb.Plugins.Cache

Synopsis

Documentation

data CacheContainer Source

Constructors

forall r . CacheBackend r => CacheContainer r 

class CacheBackend c where Source

Methods

backendCachePut :: (CacheApp a, MonadIO m) => Text -> BS.ByteString -> Integer -> c -> WhebT a b m () Source

backendCacheGet :: (CacheApp a, MonadIO m) => Text -> c -> WhebT a b m (Maybe BS.ByteString) Source

backendCacheDelete :: (CacheApp a, MonadIO m) => Text -> c -> WhebT a b m () Source

Instances

CacheBackend CacheData

In memory cache backend. Cache value will not persist after server restart and will never clear old values.

setCacheValue :: (CacheApp a, MonadIO m) => Text -> BS.ByteString -> WhebT a b m () Source

Set a cache value with an expiration of an hour

setCacheValue' :: (CacheApp a, MonadIO m) => Text -> BS.ByteString -> Integer -> WhebT a b m () Source

Set a cache value with expiration in seconds

deleteCacheValue :: (CacheApp a, MonadIO m) => Text -> WhebT a b m () Source