WaiAppStatic.Storage.Filesystem

wai-app-static-3.1.9: WAI application for static serving

Safe Haskell | None
Language | Haskell2010

WaiAppStatic.Storage.Filesystem

Contents

- Types
- Settings

Description

Access files on the filesystem.

Synopsis

- type ETagLookup = FilePath -> IO (Maybe ByteString)
- defaultWebAppSettings :: FilePath -> StaticSettings
- defaultFileServerSettings :: FilePath -> StaticSettings
- webAppSettingsWithLookup :: FilePath -> ETagLookup -> StaticSettings

# Types

type ETagLookup = FilePath -> IO (Maybe ByteString) #

How to calculate etags. Can perform filesystem reads on each call, or use some caching mechanism.

# Settings

defaultWebAppSettings #

Arguments

:: FilePath | root folder to serve from
-> StaticSettings |

Settings optimized for a web application. Files will have aggressive caching applied and hashes calculated, and indices and listings are disabled.

defaultFileServerSettings #

Arguments

:: FilePath | root folder to serve from
-> StaticSettings |

Settings optimized for a file server. More conservative caching will be applied, and indices and listings are enabled.

webAppSettingsWithLookup #

Arguments

:: FilePath | root folder to serve from
-> ETagLookup |
-> StaticSettings |

Same as `defaultWebAppSettings`, but additionally uses a specialized `ETagLookup` in place of the standard one. This can allow you to cache your hash values, or even precompute them.