Welcome! Log In Create A New Profile

Advanced

Re: cache for ngx_http_time()

Maxim Dounin
August 16, 2013 08:48PM
Hello!

On Mon, Aug 05, 2013 at 09:06:57PM +0300, Serguei I. Ivantsov wrote:

> 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.

The cache is for current time, and it's used for Date header (see
ngx_cached_http_time). The ngx_http_time() function is to print
arbitrary times, like Expires or Last-Modified, and these are
usually non-cacheable.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

cache for ngx_http_time()

Serguei I. Ivantsov 917 August 05, 2013 02:08PM

Re: cache for ngx_http_time()

Serguei I. Ivantsov 456 August 05, 2013 03:38PM

Re: cache for ngx_http_time()

Maxim Dounin 478 August 16, 2013 08:48PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready