I try to configure Google Cloud CDN to my container engine project.
Following the documentation It has either a Content-Length header or a Transfer-Encoding header in order to be cached.
My backend use gzip compression so I have Transfer-Encoding: chunked
The problem is it seems the ingress load balancer remove the Transfer-encoding header so I can't have a "cache hit"
I used "kubectl port-forward" to connect direclty to an instance backend and I have the Transfer-encoding header.
But when I connect to the external IP, the header has disappear.
Here my ingress configuration
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gateway-preprod3-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: gateway-preprod2-static-ip
spec:
tls:
- secretName: gateway-preprod-secret-2018-with-ca-7
backend:
serviceName: gateway-preprod
servicePort: 80
Here my deployment configuration
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gateway-preprod
spec:
replicas: 1
strategy:
type: RollingUpdate
minReadySeconds: 50
template:
metadata:
labels:
app: gateway-preprod
spec:
containers:
- name: gateway-preprod
image: eu.gcr.io/writecontrol-1055/gateway:v305
env:
- name: writecontrolEnv
value: preprod
ports:
- containerPort: 80
In the opposite, for certain ressources not GZIP compressed, the Content-length header is given and I have a successful "cache hit"
The kubernetes version is 1.7.12-gke.1
Here an URL to test it : https://preprod-writecontrol.ovh