Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
Cache the response of GET requests for a given duration. By default, it will use an in-memory cache with a duration of 3 seconds, with a maximum of 1000 entries. You can provide your own storage implementation by passing a Config struct to the middleware. You can also provide your own key function to generate the cache key for a given request. Headers can be used to invalidate the cache:
- Cache-Control: no-cache will bypass the cache
- Cache-Control: no-store might use the cache but will not store the response in the cache
Types ¶
type MultiHTTPWriter ¶
type MultiHTTPWriter struct { http.ResponseWriter // contains filtered or unexported fields }
MultiHTTPWriter is a http.ResponseWriter that writes the response to multiple writers
func (*MultiHTTPWriter) Unwrap ¶
func (m *MultiHTTPWriter) Unwrap() http.ResponseWriter
func (*MultiHTTPWriter) WriteHeader ¶
func (m *MultiHTTPWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.