https://github.com/sdvcrx/echo-cache
A simple echo cache middleware.
https://github.com/sdvcrx/echo-cache
cache echo echo-framework golang middleware
Last synced: 2 months ago
JSON representation
A simple echo cache middleware.
- Host: GitHub
- URL: https://github.com/sdvcrx/echo-cache
- Owner: sdvcrx
- License: mit
- Created: 2022-08-22T14:54:42.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-21T12:23:45.000Z (3 months ago)
- Last Synced: 2025-03-14T19:55:00.550Z (2 months ago)
- Topics: cache, echo, echo-framework, golang, middleware
- Language: Go
- Homepage:
- Size: 176 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# echo-cache
[](https://github.com/sdvcrx/echo-cache/actions/workflows/go.yml)
[](https://pkg.go.dev/github.com/sdvcrx/echo-cache)A simple [echo](https://echo.labstack.com/) Cache middleware.
## Install
```bash
go get -u github.com/sdvcrx/echo-cache
```## Usage
### Basic Usage
```go
import (
"github.com/sdvcrx/echo-cache"
)// ...
e.Use(cache.Cache())
```### Custom Configuration
```go
e.Use(cache.CacheWithConfig(cache.CacheConfig{
// ...
}))
```Configuration:
```go
type CacheConfig struct {
Skipper middleware.Skipper
CanCacheResponse middleware.Skipper
CachePrefix string
CacheKey CacheKeyFunc
CacheDuration time.Duration
Store store.Store
Encoder Encoder
}
```## LICENSE
MIT