Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Evercookie ¶
func Evercookie(config *Config) func(http.ResponseWriter, *http.Request, func())
*
- Port to Golang by TruongSinh <i@truongsinh.pro>
- Original work by samy kamkar, https://github.com/samyk/evercookie/ *
Types ¶
type Config ¶
type Config struct { EtagCookieName string CacheCookieName string AuthPath string PngPath string EtagPath string CachePath string }
func setCache(etag string, w web.ResponseWriter) { const cacheControlKey = "Cache-Control" h := w.Header() h.Set("Etag", etag) if h.Get(cacheControlKey) == "" { // only set cache control if there is none before // cache it ~ 1 month, as we revision almost all of our assets // 3000000 = 3e6s = 1.1408 month h.Set(cacheControlKey, "public, max-age=3000000") } return }
func DefaultConfig ¶
func DefaultConfig() *Config
Click to show internal directories.
Click to hide internal directories.