how to add caching to Microservices behind Traefik Ingress Controller?

3/30/2019

I was using a Docker-based setup with an nginx reverse proxy forwarding to Dockerized Microservices for some time. Right now I am evaluating a switch to a Kubernetes-based approach and the Traefik Ingress Controller.

The Ingress Controller provides all functionality required for this, except for one: It doesn't support caching.

The Microservices aren't very performant when it comes to serving static resources, and I would prefer to reduce the load so they can concentrate on their actual purpose, handling dynamic REST requests.

Is there any way to add caching support for Traefik-based Ingress? As there are many yet small services, I'd prefer not to spinup a dedicated Pod per Microservice if possible. Additionally, a configuration-based approach would be appreciated, if possible (maybe using a custom Operator?).

-- muffel
kubernetes
traefik
traefik-ingress

1 Answer

5/22/2019

Caching functionality is still on the wish list in Traefik project.
As a kind of workaround please check this scenario where NGINX is put in front to do caching.
I don't see any contraindications to apply the same idea in front of Traefik Ingress Controller.

-- Nepomucen
Source: StackOverflow