...

Text file src/github.com/lestrrat-go/httpcc/README.md

Documentation: github.com/lestrrat-go/httpcc

     1httpcc
     2======
     3
     4Parses HTTP/1.1 Cache-Control header, and returns a struct that is convenient
     5for the end-user to do what they will with.
     6
     7# Parsing the HTTP Request
     8
     9```go
    10dir, err := httpcc.ParseRequest(req.Header.Get(`Cache-Control`))
    11// dir.MaxAge()       uint64, bool
    12// dir.MaxStale()     uint64, bool
    13// dir.MinFresh()     uint64, bool
    14// dir.NoCache()      bool
    15// dir.NoStore()      bool
    16// dir.NoTransform()  bool
    17// dir.OnlyIfCached() bool
    18// dir.Extensions()   map[string]string
    19```
    20
    21# Parsing the HTTP Response
    22
    23```go
    24directives, err := httpcc.ParseResponse(res.Header.Get(`Cache-Control`))
    25// dir.MaxAge()         uint64, bool
    26// dir.MustRevalidate() bool
    27// dir.NoCache()        []string
    28// dir.NoStore()        bool
    29// dir.NoTransform()    bool
    30// dir.Public()         bool
    31// dir.Private()        bool
    32// dir.SMaxAge()        uint64, bool
    33// dir.Extensions()     map[string]string
    34```
    35

View as plain text