| I'm relatively new to Clojure and have been interested in writing something like this. I have a few questions/comments: - What made you decide to write CacheBustHelper in Java? I believe something like: (defn bust-cache
[input-stream]
(with-open [rdr (clojure.java.io/reader input-stream)]
(doseq [b (.read rdr)
:when (not= -1 b)]
nil)))
I'm not sure the performance difference between the two though.- Does it work with any web backend framework? Could I use something like Luminus or Fulcro? Does the request just have to follow the Ring request format? - Looks like lines 183 through 198 on core.clj could be when instead of if - what about making update-if-present: (defn update-if-present
[m & v]
(reduce (fn [acc [k f]]
(if (contains? acc k)
(update acc k f)
acc))
m
(partition 2 v)))
That would allow you to do the following: (update-if-present page-data :twitter-image cache-bust-one
:og-image cache-bust-one
:favicon cache-bust-one
:link-apple-icon cache-bust-one
:link-apple-startup-image cache-bust-one
:link-image-src cache-bust-one
:script cache-bust
:script-sync cache-bust
:js-module cache-bust
:stylesheet cache-bust
:stylesheet-async cache-bust
:manifest cache-bust-one)
Those are just some things I noticed on first glance.- |