swrcache

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 10 Imported by: 1

README

swr cache server

A dead-simple swr (stale-while-revalidate) style cache server.

  • Coalesces requests and requests the upstream in the background while in "grace" period.
  • Dead-simple as in, ignores all cache-control headers and just caches GET / HEAD requests. No cache conditions supported (yet).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(proxyTarget string, config *Config) (http.Handler, error)

func NewWithProxy

func NewWithProxy(config *Config, proxy http.Handler) (http.Handler, error)

Types

type Config

type Config struct {
	TTL   string
	Grace string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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