cache

package
v10.3.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2018 License: BSD-3-Clause, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NoCache disables the cache for a particular request,
	// can be used as a middleware or called manually from the handler.
	NoCache = client.NoCache
)

Functions

func Cache

func Cache(expiration time.Duration) *client.Handler

Cache accepts the cache expiration duration if the expiration <=2 seconds then expiration is taken by the "cache-control's maxage" header returns context.Handler, which you can use as your default router or per-route handler

All types of response can be cached, templates, json, text, anything.

Use it for server-side caching, see the `iris#Cache304` for an alternative approach that may fit your needs most.

You can add validators with this function.

func Handler

func Handler(expiration time.Duration) context.Handler

Handler accepts one single parameter: the cache expiration duration if the expiration <=2 seconds then expiration is taken by the "cache-control's maxage" header returns context.Handler.

All types of response can be cached, templates, json, text, anything.

Use it for server-side caching, see the `iris#Cache304` for an alternative approach that may fit your needs most.

it returns a context.Handler which can be used as a middleware, for more options use the `Cache`.

Examples can be found at: https://github.com/kataras/iris/tree/master/_examples/#caching

Types

This section is empty.

Directories

Path Synopsis
Package ruleset provides the basics rules which are being extended by rules.
Package ruleset provides the basics rules which are being extended by rules.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL