fix caching

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

View File

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