1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-21 13:21:17 +00:00
nginx-sso/vendor/github.com/pquerna/cachecontrol/examples/example-com.go
Knut Ahlers b8c89a5e0f
Vendor new dependencies for OIDC
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-04-23 00:50:32 +02:00

21 lines
433 B
Go

package main
import (
"github.com/pquerna/cachecontrol"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "http://www.example.com/", nil)
res, _ := http.DefaultClient.Do(req)
_, _ = ioutil.ReadAll(res.Body)
reasons, expires, _ := cachecontrol.CachableResponse(req, res, cachecontrol.Options{})
fmt.Println("Reasons to not cache: ", reasons)
fmt.Println("Expiration: ", expires.String())
}