(handle-async-cors handler
request
respond'
raise'
access-control
response-handler)
(wrap-async-cors handler & access-control)
Middleware that adds Cross-Origin Resource Sharing headers. (def handler (-> routes (wrap-cors :access-control-allow-origin #"http://example.com" :access-control-allow-methods [:get :put :post :delete])))
Middleware that adds Cross-Origin Resource Sharing headers. (def handler (-> routes (wrap-cors :access-control-allow-origin #"http://example.com" :access-control-allow-methods [:get :put :post :delete])))
(wrap-no-cache handler)
Add 'Cache-Control: no-cache' to responses. This allows the client to cache the response, but requires it to check with the server every time to make sure that the response is still valid, before using the locally cached file.
This avoids stale files being served because of overzealous browser caching, while still speeding up load times by caching files.
Add 'Cache-Control: no-cache' to responses. This allows the client to cache the response, but requires it to check with the server every time to make sure that the response is still valid, before using the locally cached file. This avoids stale files being served because of overzealous browser caching, while still speeding up load times by caching files.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close