Fork me on GitHub
#reitit
<
2018-11-03
>
ikitommi12:11:21

@hannu.hartikainen @vale tested uris with the httprouter. It can do a lot for sanitizing the urls. e.g. strip out multiple slashes from mid-uri. Also, if the use case is for the frontend, some preprosessing needs to be done for the routes. This is what @vale started with, but I suggested the ring-default handler. For potential PRs (welcome!), I would like that the current case for doing exact matches would be as fast as now, so some option to preprocess the urls & incoming requests?

ikitommi12:11:36

the regex for the end is ok as it’s on the default branch, will merge it.

Hannu Hartikainen13:11:07

Maybe frontend should have a not-found/default handler too? I agree that exact matches should just work as fast as possible, as that’s easily over 99% of all requests.

ikitommi17:11:22

btw, if someone has good insight about perf tuning, help welcome. Just run the Github API benchmarks from httprouter, reitit is 3-6x slower. Not bad for a dynamic lisp, but there is always room for improvement… https://github.com/metosin/reitit/blob/master/perf-test/clj/reitit/go_perf_test.clj