nocache

package module
v0.0.0-...-aec1ce9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2014 License: MIT Imports: 4 Imported by: 0

README

nocache wercker status

Martini middleware/handler for removing ETag related headers and adding "no cache" headers

NOTE: This middleware will work only in development mode

Usage

package main

import (
    "github.com/go-martini/martini"
    "github.com/mytrile/nocache"
)

func main() {
    m := martini.Classic()
    m.Use(nocache.UpdateCacheHeaders())
    m.Get("/", func() string {
      return "Hello world!"
    })
    m.Run()
}

The middleware will remove the following headers:

  • ETag
  • If-Modified-Since
  • If-Match
  • If-None-Match
  • If-Range
  • If-Unmodified-Since

and add the following headers:

  • Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  • Pragma: no-cache
  • Expires: Fri, 29 Aug 1997 02:14:00 EST

Meta

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateCacheHeaders

func UpdateCacheHeaders() martini.Handler

UpdateCacheHeaders removes ETag related headers and injects regular "no cache" headers

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL