graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Data.Parser.CacheControl

Description

Functions related to parsing Cache-Control header as defined in https://tools.ietf.org/html/rfc7234#section-5.2

To get max-age/s-maxage from Cache-Control header, use parseMaxAge. If you need to check other directives use parseCacheControl.

Rules which starts with obs- is not required to implement because they are maked as "obsolete" as per https://tools.ietf.org/html/rfc7230#section-1.2

Synopsis

Documentation

parseMaxAge :: Integral a => Text -> Either String a Source #

Tries to parse the max-age or s-maxage present in the value of Cache-Control header

noCacheExists :: CacheControl -> Bool Source #

Checks if the no-cache directive is present

noStoreExists :: CacheControl -> Bool Source #

Checks if the no-store directive is present

mustRevalidateExists :: CacheControl -> Bool Source #

Checks if the must-revalidate directive is present

findCCDTokenWithVal :: (Text -> Bool) -> CacheControl -> Maybe (Text, Text) Source #

parseCacheControl :: Text -> Either String CacheControl Source #

Parses a Cache-Control header and returns a list of directives

tokenParser :: Parser Text Source #

quotedStringParser :: Parser Text Source #