wai-http2-extra-0.0.0: WAI utilities for HTTP/2

Safe HaskellNone
LanguageHaskell98

Network.Wai.Middleware.Push.Referer

Description

Middleware for server push learning dependency based on Referer:.

Synopsis

Documentation

pushOnReferer :: MakePushPromise -> Middleware Source #

The middleware to push files based on Referer:. Learning strategy is implemented in the first argument. Learning information is kept for 30 seconds.

type MakePushPromise Source #

Arguments

 = URLPath

path in referer

-> URLPath

path to be pushed

-> FilePath

file to be pushed

-> IO (Maybe PushPromise) 

Making a push promise based on Referer:, path to be pushed and file to be pushed. If the middleware should push this file in the next time when the page of Referer: is accessed, this function should return Just. If Nothing is returned, the middleware learns nothing.

defaultMakePushPromise :: MakePushPromise Source #

Learn if the file to be pushed is CSS (.css) or JavaScript (.js) file AND the Referer: ends with "/" or ".html" or ".htm".

type URLPath = ByteString Source #

Type for URL path.