我正在尝试处理Nginx和Lua的传入HTTP请求。我需要在每个请求中从Redis读取蓝色,当前,我通过以下代码在每个请求中打开Redis连接:```local redis = require “resty.redis”local red = redis:new()
local ok, err = red:connect(“redis”, 6379)if not ok then ngx.say(“failed to connect: ”, err) returnend
local res, err = red:auth(“abcd”)if not res then ngx.log(ngx.ERR, err) returnend```有什么方法可以使此连接静态或单例以提高我的请求处理程序性能?