Welcome! Log In Create A New Profile

Advanced

Re: How does nginx cache work ?

September 07, 2017 04:52AM
Hi!

according to the function ngx_http_upstream_cache, I think nginx never load
the file to memory, instead, it just set a buf, which file is referenced to
this file and output it.

On 7 September 2017 at 16:31:46, ujaeek@yahoo.co.jp (ujaeek@yahoo.co.jp)
wrote:

Hi,

Currently we are modify some nginx proxy cache functions, and I would like
to know how nginx cache work?

1. does nginx cache data in memory or read from disk everytime?

for example, first I do `GET /example.jpg`, nginx will cache it and save to
disk.
next time I do `GET /example.jpg`, does nginx read the file from disk then
send to client,
or nginx just send the file from memory to client because nginx has cached
it in memory ?

2. if nginx save it in memory, what happens if the file is 1GB?

does nginx malloc a 1GB memory and save the file? or split the file into
many parts, and save it separately using
something like array or linked list?

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

How does nginx cache work ?

Anonymous User 708 September 07, 2017 04:32AM

Re: How does nginx cache work ?

tokers 595 September 07, 2017 04:52AM



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

Online Users

Guests: 281
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