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