EURODEO / femdi-test

0 stars 0 forks source link

Investigate, enable & test APISIX caching for upstream data #58

Open aaltonja opened 8 months ago

aaltonja commented 8 months ago

Apisix should respect cache-control header coming from upstream.

Discussed that we might need to implement centralised caching in APISIX. This requires co-working with data providers to understand what data and for how long it can be cached.

aaltonja commented 3 months ago

Comment from Jeremy: Vegard might provide some information for this

JoonaHa commented 3 months ago

It seems that the APISIX caches consumers when the key-auth plugin is run for the first time. It creates a simple lru-cache for 512 items for 5mins The secrets are cached here https://github.com/apache/apisix/blob/987d33d168761afd9e125ad0f7caadfef21f0bb7/apisix/secret.lua#L248 And a second time when the consumers are cached here https://github.com/apache/apisix/blob/987d33d168761afd9e125ad0f7caadfef21f0bb7/apisix/consumer.lua#L116

local lrucache = core.lrucache.new({
    ttl = 300, count = 512
})