hossein bazrafkan
hossein bazrafkan

Reputation: 109

disable cache in kubernetes Ingress

in kubernetes V 1.14.5 with ingress controller nginx-ingress-controller:0.21.0-rancher3 .I have below issue:

when userinfo api is called with internal service address (form inside cluster), it response fine (token is invalid). as below screenshot

  (( but when that API is called with its ingress name, it responses with list of permission while token is revoked. both requests use same tokens

enter image description here

I think its related to cache inside Ingress and Ingress Controller but I cant disable it vi annotation configuration

Upvotes: 1

Views: 937

Answers (2)

hossein bazrafkan
hossein bazrafkan

Reputation: 109

I've found the solution.

the root cause was related to wso2is nginx mosuled, and cache was configured there. I change cache time in nginx configuration inside wso2is

Upvotes: 1

Harsh Manvar
Harsh Manvar

Reputation: 30198

If you are using the Nginx ingress controller you can use this snippet into the annotation

nginx.ingress.kubernetes.io/configuration-snippet : |
      if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
        expires 1M;
        add_header Cache-Control "public";
      }

inside the configuration, you can keep the simple Nginx config

Upvotes: 1

Related Questions