cloudflare / cloudflare/lua-upstream-cache-nginx-module

the module is unvalid when upstream_cache_status is HIT

Abierto
#9 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C
Estrellas
124
Forks
40
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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!

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
c, lua, nginx
Área
backend, infrastructure
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.