cloudflare / cloudflare/lua-upstream-cache-nginx-module
the module is unvalid when upstream_cache_status is HIT
- Lingua principale
- C
- Stelle
- 124
- Fork
- 40
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
hi:
I use the module to set meta info when upstream_cache_status is HIT, but I found this is unvalid.
code:
header_filter_by_lua '
local http_cache = require("http_cache")
local cache_status = (ngx.var.upstream_cache_status or "")
if cache_status == "HIT" and ngx.ctx.flag == "true" then
local cache_data = http_cache.get_metadata()
local new_expire = ngx.time() - 1
if cache_data and cache_data["valid_sec"] then
http_cache.set_metadata({ valid_sec = new_expire,
fcn = { valid_sec = new_expire,
expire = new_expire } })
end
end
';
Can I use it like this? thx!
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start by reproducing the shown header_filter_by_lua configuration with upstream_cache_status set to HIT, then inspect the module's metadata API and its handling of this request phase. Done means establishing whether set_metadata is supported in this situation and documenting or correcting the observed behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, lua, nginx
- Ambito
- backend, infrastructure
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100