How to bind variable with connection in a customized module?

Liu Haifeng haifeng.813 at
Tue Jan 22 12:16:36 UTC 2013

hi all,

I want save state during a long connection (keep-alive) for performance optimization in my own HTTP handler module, thus I can peek up the saved state when handling requests, to speed up response. Actually it's quite like session concept. I saw request struct has a member ctx, but what I want is a ctx on the connection. It seems no way to save any customized variable to the ngx_connection_t structure. What's the suggested way to make this if I don't want the client hold something like session_id?

More information about the nginx mailing list