Documentation
¶
Index ¶
Constants ¶
View Source
const ( // IfNoneMatchHeader http header containing the clients CurrentSHA IfNoneMatchHeader = "If-None-Match" // EtagHeader header used to pass the CurrentSHA in responses EtagHeader = "Etag" // LastModified date when the feature set was last updated LastModifiedHeader = "Last-Modified" // CacheControlHeader sets the caches control header for the response CacheControlHeader = "Cache-Control" // CacheControl ensure no client-side or proxy caching CacheControl = "private, max-age=0, no-cache, no-store, must-revalidate, proxy-revalidate" // PragmaHeader sets the pragma header for the response PragmaHeader = "Pragma" // Pragma ensure no client-side caching Pragma = "no-cache" // ExpiresHeader sets the expires header for the response ExpiresHeader = "Expires" // Expires ensure no client-side caching Expires = "0" )
Variables ¶
This section is empty.
Functions ¶
func HTTPCachingHandler ¶
HTTPCachingHandler middleware that provides HTTP level caching using the If-None-Match header. If the value of this header contains a matching CurrentSHA this handler will write a 304 status and return.
func NotModified ¶
NotModified checks the requests If-None-Match header for a matching CurrentSHA in the Client.
func SetCacheHeaders ¶
func SetCacheHeaders(w http.ResponseWriter, r *http.Request)
SetCacheHeaders ensure response is not cached on the client. Caching should be done using the Etag and If-None-Match headers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.