I am using the Nginx slice
module to fill the cache for big files as shown here https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/
Here is a sample configuration
location / {
slice 1m;
proxy_cache cache;
proxy_cache_key $uri$is_args$args$slice_range;
proxy_set_header Range $slice_range;
proxy_cache_valid 200 206 1h;
proxy_pass http://localhost:8000;
}
The article says:
NGINX makes it possible to cache such range requests and gradually
fill the cache with the Cache Slice module, which divides files into
smaller “slices”. Each range request chooses particular slices that
cover the requested range and, if this range is still not cached, put
it into the cache. All other requests for these slices take the data
from the cache.
My question is, what happens when all the byte ranges of a file have been received from the backend and Nginx has cached all the slices. Does the Nginx still serve the requests using multiple slices or does it join all the slices to make a big file (same as the file in the backend) and then it served the requests from the big file?
As I can see that the cache key is proxy_cache_key $uri$is_args$args$slice_range;
. So, does it mean that even though Nginx has got the full content but it will still keep those slices separate and serve the byte-range requests using the slices?
Thanks