ring

petr.mensik 2017-11-30T08:35:56.000042Z

hmm, it really seems like that - however I am not sure how can I avoid it except wrapping all the middleware by myself

ikitommi 2017-11-30T11:11:38.000169Z

I don’t think the ring-defaults itself is slow, it’s just a collection of things. Someone could bench the included mw separately and see if there are slow ones. I would guess it’s the static resource encoding inspector thingie that’s causing 98% of the computation. If so, you could take some parts of those for the api-routes and apply the site-stuff only for the static routes. Does that make sense?

ikitommi 2017-11-30T11:13:17.000446Z

and, when done, some “good practise” example setup would be great.

ikitommi 2017-11-30T11:28:18.000119Z

also, ring-defaults has some parameter-settings, which also are included in compojure-api defaults. Here are the chains: * https://github.com/metosin/compojure-api/blob/master/src/compojure/api/middleware.clj#L264-L290 * https://github.com/ring-clojure/ring-defaults/blob/master/src/ring/middleware/defaults.clj#L98-L117

jazzytomato 2017-11-30T16:26:04.000829Z

I am trying to use compojure-api with spec tools but I get

Caused by: java.lang.NullPointerException, compiling:(ring/util/http_response.clj:1142:1) 
...
Can't import ring.util.response/get-charset, try updating to Ring 1.6.0+
my project looks like that
[ring/ring-core "1.6.3"]
                 [metosin/compojure-api "2.0.0-alpha15"]
and lein deps :tree only yields ring-core version 1.6.3 I can't figure out what's wrong 😭

ikitommi 2017-11-30T16:35:44.000152Z

@jazzytomato do you use lein-ring? It brings extra (potentially) old deps at runtime, overriding the project setup. Updating to latest should help.

jazzytomato 2017-11-30T16:36:25.000130Z

I don't use lein-ring

jazzytomato 2017-11-30T16:44:01.000258Z

I think lein clean fixed it...

jazzytomato 2017-11-30T16:44:26.000876Z

sorry, I'm a newbie 😄

ikitommi 2017-11-30T16:45:54.000064Z

was about to suggest lein-clean :)

jazzytomato 2017-11-30T16:58:04.000327Z

thanks 🙇