My flask python service on Openshift Origin is adding a Cache-Control: private.
My cache server does not make cache because this.
How can I remove this from service?
I Have added this configuration but has no effect:
apiVersion: v1
kind: Route
metadata:
annotations:
haproxy.router.openshift.io/disable_cookies: 'true'
When I performa a curl the header still returns:
$ curl -I http://api.example.com/
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 87160
Cache-Control: max-age=300
Vary: Accept
Expires: Fri, 07 Apr 2017 18:09:44 GMT
Set-Cookie: OPENSHIFT_EDGE_example-api_example-api_SERVERID=8326069cf7d473e9305855a9a08aaef4; path=/; HttpOnly; Secure
Cache-control: private
Connection: keep-alive
At a guess the haproxy router in OpenShift adds this because by default it uses a cookie to implement sticky sessions, to try and ensure traffic from a user goes back to same application instance.
As a result, the cookie being returned would be specific to the user.
There is a way of changing how haproxy manages this, but not sure of details of what you need to change.
Graham is correct, this is a sticky session issue.
Remove the haproxy.router.openshift.io/balance: roundrobin annotation from the route, and the Cache-Control: private goes away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With