Score:0

Does Ubuntu 20.04 nginx support range requests?

kr flag

It implies in [https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/][1] that nginx supports range requests only if Cache Slicing is compiled into nginx.

Does Ubuntu 20.04 nginx support range requests?

waltinator avatar
it flag
"Range requests"? What do you mean by "Range requests"? What have you tried?
kr flag
AFAIK range requests allow big files to be downloaded in parts so that the download can resume if there is a timeout or crash. I haven't tried anything yet but I've seen comments by people who've used a browser or an Android app to download a large file e.g. from Google of a SDK platform.
Score:0
co flag

I guess nginx-extras and nginx-full package should have it (at least has it in debian).

But you could find it out by yourself:

?sudo? nginx -V 2>&1 | tr " " "\n" | grep slice

BTW, cache slicing is only necessary if you want support range request in dynamic (e. g. proxying) content. Moreover it is used to split or else to implement effective cache of big response in chunks, which are under your control on proxying side.
For a simple range request to static resource (e. g. clients accessing PDF files or archives) it is not needed at all, nginx can serve Range: bytes=n-m request without any issue.

Just try this to test it:

curl -v -r 0-1000 --HEAD 'http://example.com/download/some-file.pdf'

and see whether it'd answer with 206 Partial Content.

In this way you can even do it for any dynamic content without slice module too, e. g. using HTTP redirect to previously stored file in some download location "caching" your documents internally in one piece.
And ngx_http_slice_module is something for partial caching e. g. for splitting a large response in few small responses behind backend upstream.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.