fast-twitch.middlewares.not-modified
Complete generated reference for fast-twitch.middlewares.not-modified
Usage and execution boundary
For GET/HEAD, compares request validators with response ETag/Last-Modified. A match produces 304, removes/disposes the body and removes content-type/content-length. It does not generate an ETag automatically.
(ns application.middleware
(:require [fast-twitch.middlewares.not-modified :as middleware]))
(defn handler [_]
{:status 200 :headers {"content-type" "text/plain"} :body "Hello"})
(def app (middleware/wrap-not-modified handler))
This defines the Ring handler portion. Adapt app through routing/ft-handler or pass it to server/listen!; startup instructions and a complete walkthrough show the surrounding project.
Wrapper order and all middleware families. The function reference below preserves the upstream signatures and source links; helper functions do not all share the wrapper's arity.
Upstream function reference
Short-circuits cacheable responses when validators show the resource is unchanged.
not-modified-response
(not-modified-response response request)
Function.
Replaces a cache hit response with a 304 response for GET and HEAD requests. Source
wrap-not-modified
(wrap-not-modified handler)
Function.
Wraps a handler so conditional requests can return 304 responses. Source