cache for ngx_http_time()

Serguei I. Ivantsov manowar at gsc-game.kiev.ua
Mon Aug 5 18:06:57 UTC 2013


Hi!

ngx_http_time() is called once per request and it call a heavy
ngx_sprintf() function.
Why not cache the output for one second (resolution of time_t)?
I find nice time caching framework on ngx_times.c, with slots and memory
barriers, but ngx_http_time() is not using it for some reason.
In this case, probably, it is easier to cache just one string buffer and
time_t value per process.



More information about the nginx-devel mailing list