fix caching

This commit is contained in:
Karol Wypchlo 2021-10-26 16:47:06 +02:00
parent d13a68d825
commit 40d0bb0e4d
No known key found for this signature in database
GPG Key ID: C92C016317A964D0
1 changed files with 2 additions and 2 deletions

View File

@ -27,11 +27,11 @@ location / {
ngx.say(err or res.body)
ngx.exit(ngx.status)
end
else
ngx.var.skylink = res.body
local cache_ttl = 300 -- 5 minutes cache expire time
cache:set(ngx.var.host, ngx.var.skylink, cache_ttl)
else
ngx.var.skylink = res.body
end
else
ngx.var.skylink = cache_value