Skip to content

Commit

Permalink
Add custom caching policies for geoweb files & possibility to customi…
Browse files Browse the repository at this point in the history
…ze with variables (#23)
  • Loading branch information
Jusaa authored Sep 13, 2023
1 parent c775841 commit 9872c36
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/geoweb-frontend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.2.2
version: 2.2.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
3 changes: 2 additions & 1 deletion charts/geoweb-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,5 @@ The following table lists the configurable parameters of the GeoWeb frontend cha
| `frontend.awsAccessKeyId` | AWS_ACCESS_KEY_ID for authenticating to S3 | |
| `frontend.awsAccessKeySecret` | AWS_SECRET_ACCESS_KEY for authenticating to S3 | |
| `frontend.awsDefaultRegion` | Region where your S3 bucket is located | |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.rules` | Extra nginx configuration rules, like cache headers | See reference in `values.yaml` |
6 changes: 5 additions & 1 deletion charts/geoweb-frontend/templates/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ metadata:
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, PUT, GET, POST, OPTIONS, PATCH, HEAD"
nginx.ingress.kubernetes.io/cors-allow-methods: "GET"
{{- if .Values.ingress.rules }}
nginx.ingress.kubernetes.io/configuration-snippet: |
{{- .Values.ingress.rules | nindent 6 }}
{{- end }}
spec:
ingressClassName: nginx
rules:
Expand Down
9 changes: 8 additions & 1 deletion charts/geoweb-frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@ frontend:
GW_FEATURE_MENU_FE_VERSION: true

ingress:
name: nginx-ingress-controller # Sync with nginx-ingress-controller/values.yaml
name: nginx-ingress-controller
rules: |
if ($request_uri ~* \.(json)) {
add_header Cache-Control "no-cache";
}
if ($request_uri ~* \.(woff2|svg|webmanifest)) {
add_header Cache-Control "max-age=604800";
}

0 comments on commit 9872c36

Please sign in to comment.