Hello again :-)
I create a LUA dictionary via lua_shared_dict and store a LUA function in it. But the dictionary will only return nil, not my function.
Here is an example:
lua_shared_dict my_global_code_cache 10m;
init_by_lua '
local code = function() end
ngx.shared.global_code_cache:set("foo", code)
assert(ngx.shared.global_code_cache:get("foo"))
';
If I create a real LUA dictionary instead via init_by_lua, it works - I can store a LUA function and use it e.g. in body_filter_by_lua. But then I don't get the expiry setting.
Is it possible to store a LUA function in a lua_shared_dict and how do I do it?
Thank you!
Stefan