httpcache

package
v2.1.0-unotech Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// The network address of this cache instance; required.
	Self string `json:"self,omitempty"`

	// A list of network addresses of cache instances in the group.
	Peers []string `json:"peers,omitempty"`

	// Maximum size of the cache, in bytes. Default is 512 MB.
	MaxSize int64 `json:"max_size,omitempty"`
	// contains filtered or unexported fields
}

Cache implements a simple distributed cache.

NOTE: This module is a work-in-progress. It is not finished and is NOT ready for production use. [We need your help to finish it! Please volunteer in this issue.](https://github.com/Unotechsoftware/caddy/issues/2820) Until it is finished, this module is subject to breaking changes.

Caches only GET and HEAD requests. Honors the Cache-Control: no-cache header.

Still TODO:

- Eviction policies and API - Use single cache per-process - Preserve cache through config reloads - More control over what gets cached

func (Cache) CaddyModule

func (Cache) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Cache) Provision

func (c *Cache) Provision(ctx caddy.Context) error

Provision provisions c.

func (*Cache) ServeHTTP

func (c *Cache) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

func (*Cache) Validate

func (c *Cache) Validate() error

Validate validates c.

Jump to

Keyboard shortcuts

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