From 1c3219e93f16cde768d90be3b360f0c6c78231cf Mon Sep 17 00:00:00 2001 From: James Elliott Date: Tue, 3 Jan 2023 14:49:02 +1100 Subject: [PATCH] perf(server): cached openapi document (#4674) This should lead to a small performance gain by caching the openapi.yml with etags as well as eliminating the use of nonce crypto generation when not required. --- .yamllint.yml | 1 + api/index.html | 16 +- api/openapi.yml | 454 ++++-------------- .../content/en/reference/guides/templating.md | 20 + internal/middlewares/authelia_context.go | 5 + internal/middlewares/authelia_context_test.go | 66 ++- internal/middlewares/const.go | 1 + internal/server/const.go | 15 +- internal/server/handlers.go | 14 +- internal/server/server.go | 4 + internal/server/server_test.go | 14 +- internal/server/template.go | 170 +++++-- internal/templates/const.go | 1 - internal/templates/funcs.go | 94 +++- internal/templates/funcs_test.go | 94 ++++ internal/templates/provider.go | 60 +++ internal/templates/types.go | 11 + internal/templates/util.go | 13 +- 18 files changed, 631 insertions(+), 422 deletions(-) diff --git a/.yamllint.yml b/.yamllint.yml index 1d8112fd5..66bafeb8f 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -9,6 +9,7 @@ yaml-files: - '.yamllint' ignore: | + api/openapi.yml docs/pnpm-lock.yaml internal/configuration/test_resources/config_bad_quoting.yml web/pnpm-lock.yaml diff --git a/api/index.html b/api/index.html index e7a8dfcf0..7d41d83af 100644 --- a/api/index.html +++ b/api/index.html @@ -4,10 +4,10 @@ Swagger UI - - - -