Hi Igor - I actually just resolved the issue I was having. I realised I had
lua_code_cache set to
off.
On Monday, 3 October 2016 10:54:04 UTC+1, Mark Kelly wrote:
Hi Igor,
I'm also seeing the same issue (using the lrucache code the same way as you are). From what I've seen, lrucache it should keep data from one request to the next. Did you manage to resolve the issue? If so what was the problem?
Many thanks,
Mark.
On Thursday, 25 August 2016 10:21:02 UTC+1, Igor Clark wrote:
Hi folks,
Trying to use lrucache to keep some lua term data in memory. I
have the example from the docs running fine.
If I add these functions to the myapp module:
function _M.set( k, v )
return c:set( k, v )
end
function _M.get( k )
return c:get( k )
end
and call them like this:
local myapp = require "myapp"
myapp.set( "hi", "there" )
ngx.say( myapp.get( "hi" ) )
it works fine in the context of one request, but if i remove the
"set()" call and hit the endpoint again, it just says "nil".
The doc says "
your cache is always limited to the current
OS process (like the current nginx worker process)" - but this
happens even when I set "worker_processes 1;" in the main
nginx.conf.
What am I doing wrong, or perhaps not
understanding correctly? Should it not keep the data from one
request to the next? What's the use case, if not?
Thanks for any help, I'm scratching my head
at the moment!
Cheers,
Igor