diff --git a/deployment/k3s/templates/networking/ingress.yaml b/deployment/k3s/templates/networking/ingress.yaml index 2d3cd4e5c..ec4169a8d 100644 --- a/deployment/k3s/templates/networking/ingress.yaml +++ b/deployment/k3s/templates/networking/ingress.yaml @@ -31,6 +31,7 @@ spec: port: 8080 middlewares: - name: stripprefix + - name: compress - name: cache-2-months - kind: Rule match: Host(`{{ $.Values.url }}`) && PathPrefix(`/cdn/`) diff --git a/deployment/k3s/templates/networking/middleware/compress-middleware.yaml b/deployment/k3s/templates/networking/middleware/compress-middleware.yaml new file mode 100644 index 000000000..29a14e9af --- /dev/null +++ b/deployment/k3s/templates/networking/middleware/compress-middleware.yaml @@ -0,0 +1,6 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: compress +spec: + compress: {} diff --git a/docker-compose.yml b/docker-compose.yml index b55b27f14..9f31a523a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,8 +76,10 @@ services: - "traefik.http.routers.navigatum-tileserver.entrypoints=webs" - "traefik.http.routers.navigatum-tileserver.tls.certresolver=leacme" - "traefik.http.routers.navigatum-tileserver.rule=Host(`nav.tum.de`) && PathPrefix(`/maps/`)" - - "traefik.http.routers.navigatum-tileserver.middlewares=navigatum-stripprefix@docker" + - "traefik.http.routers.navigatum-tileserver.middlewares=navigatum-stripprefix@docker, navigatum-compress@docker, navigatum-compress@docker, navigatum-cache-2m@docker" - "traefik.http.middlewares.navigatum-stripprefix.stripprefix.prefixes=/maps" + - "traefik.http.middlewares.navigatum-compress.compress=true" + - "traefik.http.middlewares.navigatum-cache-2m.headers.customrequestheaders.Cache-Control=public, max-age=5184000" - "traefik.http.services.navigatum-tileserver.loadbalancer.server.port=8080" networks: - traefik_traefik