/browser-caching

Provides ring middleware for browser cache hinting by file type

Primary LanguageClojureEclipse Public License 1.0EPL-1.0

ring.middleware.browser-caching

Middleware for ring to provide configurable cache control headers to browsers.

Usage

Add this to your Leiningen project.clj dependencies:

Clojars Project

To use, simply provide a map of filetypes with the associated number of seconds you want to send for Cache-Control: max-age=.

(ns app.core
  (:use  [ring.middleware.browser-caching])

(def app
  (wrap-browser-caching handler {"text/javascript" 360000
                                 "text/html" 0})

License

Copyright © 2015 Stephen Lester

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.