distribution/registry/api
Aaron Lehmann 853e2e92d8 Do not recreate mux router for each incoming request
(*App).context, called in the HTTP handler on each request, creates a
URLBuilder, which involves calling Router(). This shows up in profiles a
hot spot because it involves compiling the regexps which define all the
routes. For efficiency, cache the router and return the same object each
time.

It appears to be safe to reuse the router because GetRoute is the only
method ever called on the returned router object.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2022-07-08 14:17:17 -07:00
..
errcode Correct spelling: decription -> description 2021-02-03 13:12:23 +01:00
v2 Do not recreate mux router for each incoming request 2022-07-08 14:17:17 -07:00