fix caching
This commit is contained in:
parent
d13a68d825
commit
40d0bb0e4d
|
@ -27,11 +27,11 @@ location / {
|
||||||
ngx.say(err or res.body)
|
ngx.say(err or res.body)
|
||||||
ngx.exit(ngx.status)
|
ngx.exit(ngx.status)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
ngx.var.skylink = res.body
|
||||||
|
|
||||||
local cache_ttl = 300 -- 5 minutes cache expire time
|
local cache_ttl = 300 -- 5 minutes cache expire time
|
||||||
cache:set(ngx.var.host, ngx.var.skylink, cache_ttl)
|
cache:set(ngx.var.host, ngx.var.skylink, cache_ttl)
|
||||||
else
|
|
||||||
ngx.var.skylink = res.body
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ngx.var.skylink = cache_value
|
ngx.var.skylink = cache_value
|
||||||
|
|
Reference in New Issue