<p>I'm looking for a fast HTTP response of cacheable data between services in Kubernetes.</p>

<p>Since my apps are already container-native, I don't want to code in my application the logic of caching, neither via cache lib. The apps are focused mainly on business logic.</p>

<p>I've searched how to configure caching between services and didn't find any Istio configuration to do that, only an issue in the Envoy repository <a href="https://github.com/envoyproxy/envoy/issues/868" rel="nofollow noreferrer">Support HTTP caching</a> and these ongoing related PRs: <a href="https://github.com/envoyproxy/envoy/pull/7198" rel="nofollow noreferrer">#7198</a>, <a href="https://github.com/envoyproxy/envoy/pull/9878" rel="nofollow noreferrer">#9878</a>, also this <a href="https://www.youtube.com/watch?v=x1SomOy431I" rel="nofollow noreferrer">talk</a> and this <a href="https://docs.google.com/document/d/1WPuim_GzhfdsnIj_tf-fIeutK0jO4aVQfVrLJFoLN3g/view" rel="nofollow noreferrer">design spec</a>.</p>

<p>On the issue page, in the first comment, someone mentions they are using Nginx as a proxy to cache some API calls. But I don't know if it is the right choice. </p>

<p>Is there a simpler alternative to achieve HTTP caching in the mesh? </p>

ethanxyz_0
<p>Recently we developed a solution using istio&amp;golang to cache service to service communications.</p>
<p>The solution called as &quot;reverse proxy sidecar cache&quot;.</p>
<p>Basically you deploy another container in your pod (which is cache container). And you configure routing rules to your pod via istio's VirtualServices. The requests you specify in VirtualService goes to your cache container first, it checks cache storage and returns response if data exists otherwise proxies request to application container.</p>
<p>Overall design looks like:</p>
<p><a href="https://i.stack.imgur.com/trfo5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/trfo5.png" alt="enter image description here" /></a></p>
<p>For example here is an istio VirtualService yaml which routes all get requests to cache container (runs on 9191 port):</p>
<pre><code>apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: foo
spec:
  gateways:
  - foo-gateway
  hosts:
  - foo
  http:
  - match:
    - method:
        exact: GET
    route:
    - destination:
        host: foo
        port:
          number: 9191
  - route:
    - destination:
        host: foo
        port:
          number: 8080
</code></pre>
<p>Here you can find the article we wrote about it: <a href="https://medium.com/trendyol-tech/trendyol-platform-team-caching-service-to-service-communications-on-kubernetes-istio-82327589b935" rel="nofollow noreferrer">https://medium.com/trendyol-tech/trendyol-platform-team-caching-service-to-service-communications-on-kubernetes-istio-82327589b935</a></p>
<p>Here is the project repository: <a href="https://github.com/Trendyol/sidecache" rel="nofollow noreferrer">https://github.com/Trendyol/sidecache</a></p>
