项目过程中需要一个运行机制:用户请求响应之后,再执行其他操作,比如写入缓存。不知道Openresty支不支持这样的功能,用哪个函数?
Hello! On Mon, Oct 20, 2014 at 12:47 AM, mem phis wrote: > http://wiki.nginx.org/HttpLuaModule#ngx.eof > > 这个应该是你需要的 > 使用 0 延时的 timer [1] 在这里或许更好一些,毕竟 ngx.eof() 之后的操作仍属于当前请求处理程序的上下文中,因此会推迟当前连接被 server 端断开,在 HTTP keepalive 的场景下还是会给客户端引入额外延时(但帐会算在同一连接上的下一个 http 请求的头上)。 Regards, -agentzh [1] https://github.com/openresty/lua-nginx-module#ngxtimerat