Categorygithub.com/satoshun/go-http-cache
repositorypackage
0.5.0
Repository: https://github.com/satoshun/go-http-cache.git
Documentation: pkg.go.dev

# Packages

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

# README

HTTP Cache for Go

GoDoc Build Status

Reuse response body on Etag, Last-Modified, Expires and Cache-Control.

Usage

client := &http.Client{}
c := cache.NewMemoryCacheClient(client)
r, _ := http.NewRequest("GET", <url>, nil)
res, err := c.DoWithCache(r)

more detail example.

bonus

cachestat: cache check command

## install
go get github.com/satoshun/go-http-cache/cmd/cachestat

## execute
cachestat https://www.google.co.jp/images/nav_logo242.png https://www.google.com/textinputassistant/tia.png

Not Modified - https://www.google.co.jp/images/nav_logo242.png
Use Cache - https://www.google.com/textinputassistant/tia.png

implements on memcached

memcached sample.