My situation is: cache is enabled, lookups are happening but no cache hits.
This is my configuration:
cache cache-foo
total-max-size 32
max-object-size 1024
max-age 120
backend foo_backend
http-request cache-use cache-foo if { path_beg /api/ }
server app1 10.116.0.1:80 check
server app2 10.116.0.2:80 check
server app3 10.116.0.3:80 check
http-response cache-store cache-foo
I enabled the cache via dataplane. I can check that the cache is running by connecting to the socket and running show cache
:
show cache
0x7f100f50a03a: cache-foo (shctx:0x7f100f50a000, available blocks:32768)
Running show stats
I can see that there are about 50 "Cache Lookups" but 0 "Cache hits".
I assume that since I'm getting Lookups, that the cache data is being searched for, but somehow the cache is not being populated.
Could this be because of the order of the statements in the backend
definition? If so, is there a way to change them via the dataplane-api?