Categorygithub.com/sdvcrx/echo-cache
modulepackage
0.1.0
Repository: https://github.com/sdvcrx/echo-cache.git
Documentation: pkg.go.dev

# README

echo-cache

Build Status PkgGoDev

A simple echo Cache middleware.

Install

go get -u github.com/sdvcrx/echo-cache

Usage

Basic Usage

import (
    "github.com/sdvcrx/echo-cache"
)

// ...

e.Use(cache.Cache())

Custom Configuration

e.Use(cache.CacheWithConfig(cache.CacheConfig{
  // ...
}))

Configuration:

type CacheConfig struct {
    Skipper          middleware.Skipper
    CanCacheResponse middleware.Skipper
    CachePrefix      string
    CacheKey         CacheKeyFunc
    CacheDuration    time.Duration
    Store            store.Store
    Encoder          Encoder
}

LICENSE

MIT

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
Cache default skipper only cache GET/HEAD method and headers not contain `Range`.
Default canCacheResponse skipper will skip response cache if: - response status code not in (200, 301, 308) - response headers not contains `set-cookie`.
No description provided by the author

# Constants

No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

Interface that marshal/unmarshal `Response`.
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author