Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCacheNotFound = errors.New("cache not found")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Delete ¶
func (c *Cache) Delete(req *http.Request, opts *DeleteOptions) error
Delete removes the Response object from the cache. This method only purges content of the cache in the data center that the Worker was invoked. Returns ErrCacheNotFount if the response was not cached.
func (*Cache) Match ¶
Match returns the response object keyed to that request. docs: https://developers.cloudflare.com/workers/runtime-apis/cache/#match
func (*Cache) Put ¶
Put attempts to add a response to the cache, using the given request as the key. Returns an error for the following conditions - the request passed is a method other than GET. - the response passed has a status of 206 Partial Content. - Cache-Control instructs not to cache or if the response is too large. docs: https://developers.cloudflare.com/workers/runtime-apis/cache/#put
type DeleteOptions ¶
type DeleteOptions struct {
IgnoreMethod bool
}
type MatchOptions ¶
type MatchOptions struct {
IgnoreMethod bool
}