org.http4s.server.staticcontent

Type members

Classlikes

trait CacheStrategy[F[_]]

Cache the body of a Response for future use

Cache the body of a Response for future use

A CacheStrategy acts like a after filter in that it can look at the Response and Uri of the Request and decide if the body for the response has already been cached, needs caching, or to let it pass through.

object FileService
class MemoryCache[F[_]] extends CacheStrategy[F]

CacheStrategy that will cache all Response bodies in local memory

CacheStrategy that will cache all Response bodies in local memory

This is useful when serving a very limited amount of static content and want to avoid disk access.

Companion
object
object MemoryCache
Companion
class
class NoopCacheStrategy[F[_]] extends CacheStrategy[F]

Cache strategy that doesn't cache anything, ever.

Cache strategy that doesn't cache anything, ever.

Companion
object
Companion
class
Value Params
basePath

prefix of the path files will be served from

blocker

execution context to use when collecting content

bufferSize

size hint of internal buffers to use when serving resources

cacheStrategy

strategy to use for caching purposes.

classLoader

optional classloader for extracting the resources

pathPrefix

prefix of the Uri that content will be served from

preferGzipped

whether to serve pre-gzipped files (with extension ".gz") if they exist

Companion
object
Value Params
blocker

execution context for blocking I/O

cacheStrategy

strategy to use for caching purposes.

classLoader

optional classloader for extracting the resources

filter

To filter which assets from the webjars should be served

preferGzipped

prefer gzip compression format?

Companion
object
Companion
class

Value members

Concrete methods

def fileService[F[_]](config: Config[F])(implicit evidence$1: Async[F]): HttpRoutes[F]

Make a new org.http4s.HttpRoutes that serves static files.

Make a new org.http4s.HttpRoutes that serves static files.

def resourceServiceBuilder[F[_]](basePath: String): ResourceServiceBuilder[F]

Make a new org.http4s.HttpRoutes that serves static files, possibly from the classpath.

Make a new org.http4s.HttpRoutes that serves static files, possibly from the classpath.

Make a new org.http4s.HttpRoutes that serves static files from webjars

Make a new org.http4s.HttpRoutes that serves static files from webjars