Hello!
The If-Unmodified-Since and If-Match header will lead the Nginx "filter finalize",
and this process will clear all modules' context, includes ngx_lua. Moreover, the ngx.ctx
is really a table which anchored in ngx_lua's context. So when the context was cleared,
the ngx.ctx would be collected by LuaJIT GC.
You can bypass this limitation by using my lua-resty-ctxdump:
https://github.com/tokers/lua-resty-ctxdump