gocraft/web — pull request #19 by elithrar (2014-05-23 04:30:24+00:00)
Title: Added NoCache middleware & created new middleware package.

I've created a quick bit of middleware for wrapping either private routes or API endpoints that users do not want cached (at all). It sets `Expires` to the Unix epoch, `Cache-Control` with a `max-age=0`, and `X-Accel-Expires` (commonly interpreted by proxies) to `0` — most of this leans on the [nginx docs](http://wiki.nginx.org/HttpProxyModule).

In addition I've also split out the middleware into it's own sub-package in an effort to provide some breathing room in the namespace. This may also allow for the package to be split into its own repo in the future. Given that this is a little opinionated I'm happy to put `nocache.go` back into the existing `web` package if you prefer.