MFlow-0.4.5.11: stateful, RESTful web framework

Safe HaskellNone
LanguageHaskell98

MFlow.Forms.Cache

Description

Composable cache and HTTP header directives. Intended to permit each widget to express his caching needs to the whole page The page will compile them and choose the most strict ones Autorefreshed, push and witerate'd widgets do not inherit the page rules. they must specify their own.

The composition rules are explained in the corresponding combinators. This is a work in progress

Synopsis

Documentation

resetCachePolicy :: (MonadState (MFlowState v) m, Monad m) => m () Source

To delete all previous directives

setCachePolicy :: (MonadState (MFlowState v) m, Monad m) => m () Source

Return the composition of the current directives. Used by the page internally

noCache :: (MonadState (MFlowState v) m, MonadIO m) => m () Source

Add no-cache to the Cache-Control header directive. It deletes all expires and put max-age=0

It means that the widget need not to be cached

noCache' :: (MonadState (MFlowState v) m, MonadIO m) => ByteString -> m () Source

Add no-cache: string to the Cache-Control header directive

It deletes the header string (sensible cookies for example) from the data stored in the cache

noStore :: (MonadState (MFlowState v) m, MonadIO m) => m () Source

Add no-store to the Cache-Control header directive. It deletes expires and put max-age: 0

Stronger kind of noCache. Not even store temporally

expires :: (MonadState (MFlowState v) m, MonadIO m) => ByteString -> m () Source

Add expires: string to the Cache-Control header directive. it deletes max-age Currently it takes the last one if many

The page will be cached until this date

maxAge :: (MonadState (MFlowState v) m, MonadIO m) => Int -> m () Source

Add max-age: seconds to the Cache-Control header directive. if there are more than one, it chooses the lower one

The page will be stored in the cache for that amount of seconds

private :: (MonadState (MFlowState v) m, MonadIO m) => m () Source

Add private to the Cache-Control header directive. it delete public if any

It means that the page that holds the widget must not be shared by other users.

public :: (MonadState (MFlowState v) m, MonadIO m) => m () Source

Add public to the Cache-Control header directive.

Means that the cache can share the page content with other users.

sMaxAge :: (MonadState (MFlowState v) m, MonadIO m) => Int -> m () Source

Add sMaxAge seconds to the Cache-Control header directive. if many, chooses the minimum

Specify the time to hold the page for intermediate caches: for example proxies and CDNs.

noTransform :: (MonadState (MFlowState v) m, MonadIO m) => m () Source

Add noTransform to the Cache-Control header directive.

Tell CDNs that the content should not be transformed to save space and so on

proxyRevalidate :: (MonadState (MFlowState v) m, MonadIO m) => m () Source

Add proxyRevalidate to the Cache-Control header directive.

The same than mustRevalidate, for shared caches (proxies etc)

etag :: (MonadState (MFlowState v) m, MonadIO m) => ByteString -> m () Source

Add etag string to the header directives.

It is a resource identifier for the page that substitutes the URL identifier

vary :: (MonadState (MFlowState v) m, MonadIO m) => ByteString -> m () Source

Add vary string to the header directives.

Usually the page add this identifier to the URL string, that is the default identifier So the same page with different etags will be cached and server separately