Skip to content

A standard compatible HTTP Cache middleware for negroni.

License

Notifications You must be signed in to change notification settings

trumanw/negroni-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

negroni-cache

Go Report Card Build Status Coverage Status

A standard compatible(RFC 7234) HTTP Cache middleware for negroni.

Usage

package main

import (
    "fmt"
    "net/http"

    "github.com/urfave/negroni"
    cah "github.com/trumanw/negroni-cache"
)

func main() {
    mux := http.NewServeMux()
    mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
          fmt.Fprintf(w, "Welcome to the home page!")
    })

    n := negroni.Classic()
    n.Use(cah.NewMiddleware(cah.NewMemoryCache()))
    n.UseHandler(mux)
    n.Run(":3000")
}

About

A standard compatible HTTP Cache middleware for negroni.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published