powermanlc commented on issue #1768:
URL:
https://github.com/apache/incubator-apisix/issues/1768#issuecomment-650089504
I still have questions about cache.
**example**
**key-auth.lua**
```
local consumer_conf = consumer.plugin(plugin_name)
if not consumer_conf then
return 401, {message = "Missing related consumer"}
end
local consumers = core.lrucache.plugin(plugin_name, "consumers_key",
consumer_conf.conf_version,
create_consume_cache, consumer_conf)
local create_consume_cache
do
local consumer_ids = {}
function create_consume_cache(consumers)
core.table.clear(consumer_ids)
for _, consumer in ipairs(consumers.nodes) do
core.log.info("consumer node: ",
core.json.delay_encode(consumer))
consumer_ids[consumer.auth_conf.key] = consumer
end
return consumer_ids
end
end -- do
```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]