<html><body><div style="color:; background-color:; font-family:MS PGothic, sans-serif;font-size:12pt"><div>Hi, </div><div><br></div><div>Currently we are modify some nginx proxy cache functions, and I would like to know how nginx cache work?</div><div><br></div><div>1. does nginx cache data in memory or read from disk everytime?</div><div><br></div><div>for example, first I do `GET /example.jpg`, nginx will cache it and save to disk.</div><div>next time I do `GET /example.jpg`, does nginx read the file from disk then send to client, </div><div>or nginx <span style="font-size: 12pt;">just send the file from memory to client because nginx</span><span style="font-size: 12pt;"> has cached it </span><span style="font-size: 12pt;">in memory </span><span style="font-size: 12pt;">?</span></div><div><br></div><div>2. if nginx save it in memory, what happens if the file is 1GB?</div><div><br></div><div>does nginx malloc a 1GB memory and
save the file? or split the file into many parts, and save it separately using </div><div>something like array or linked list?</div><div><br></div><div>Thanks</div></div></body></html>