View Source
const (
	// HeaderCacheControl as in
	HeaderCacheControl = "Cache-Control"
	// HeaderExpires as in
	HeaderExpires = "Expires"
	// HeaderLastModified as in
	HeaderLastModified = "Last-Modified"
	// HeaderIfModifiedSince as in
	HeaderIfModifiedSince = "If-Modified-Since"


This section is empty.


func FormatTime

func FormatTime(t time.Time) string

FormatTime format time

func ParseTime

func ParseTime(raw string) time.Time

ParseTime parse time


type CacheData

type CacheData struct {
	LastModified string
	Body         []byte
	Head         Head

CacheData cache data

type Head struct {
	StatusCode int
	Header     http.Header

Head ...

type Pragma

type Pragma struct {
	IfModifiedSince time.Time
	LastModified    time.Time
	NoCache         bool
	MaxAge          time.Duration
	Expires         time.Time

Pragma handle pragmatic information/directives for caching

func CreatePragma

func CreatePragma(header http.Header) *Pragma

CreatePragma to create new instance of CacheControl from request

func (*Pragma) Header

func (c *Pragma) Header() http.Header

Header set header

func (*Pragma) String

func (c *Pragma) String() string

type Store

type Store struct {
	DefaultMaxAge time.Duration
	PrefixKey     string

Store ...

func (*Store) Middleware

func (s *Store) Middleware(next echo.HandlerFunc) echo.HandlerFunc

Middleware ...

Source Files