Commit 72e70246 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Improved encyclopedia GUI performance, modified gzip defaults, updated nginx...

Improved encyclopedia GUI performance, modified gzip defaults, updated nginx to redirect to encyclopedia index.html.
parent e62360c9
Pipeline #77850 passed with stages
in 29 minutes and 28 seconds
Subproject commit 63515c329818e98af95b70c97f96b1449bfc41ff
Subproject commit 19f62f27cfb408b8c28684cd3b8d52b00e1c27f0
......@@ -365,7 +365,7 @@ def query_api_curl(*args, **kwargs):
return 'curl -X POST %s -H "accept: application/json" --output "nomad.json"' % url
def enable_gzip(level: int = 5, min_size: int = 150):
def enable_gzip(level: int = 1, min_size: int = 1024):
"""
Args:
level: The gzip compression level from 1-9
......
......@@ -741,6 +741,7 @@ calculations_result = api.model("calculations_result", {
@ns.route("/materials/<string:material_id>/calculations")
class EncCalculationsResource(Resource):
@enable_gzip()
@api.response(404, "Suggestion not found")
@api.response(400, "Bad request")
@api.response(200, "Metadata send", fields.Raw)
......
......@@ -36,6 +36,17 @@ data:
proxy_pass http://{{ include "nomad.fullname" . }}-app:8000;
}
location {{ .Values.proxy.external.path }}/encyclopedia/ {
proxy_intercept_errors on;
error_page 404 = @redirect_to_encyclopedia_index;
proxy_pass http://{{ include "nomad.fullname" . }}-app:8000;
}
location @redirect_to_encyclopedia_index {
rewrite ^ {{ .Values.proxy.external.path }}/encyclopedia/index.html break;
proxy_pass http://{{ include "nomad.fullname" . }}-app:8000;
}
location ~ \/gui\/(service-worker\.js|meta\.json)$ {
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment