comparison src/http/ngx_http_upstream.c @ 5621:345e4fd4bb64

Range filter: single_range flag in request. If set, it means that response body is going to be in more than one buffer, hence only range requests with a single range should be honored. The flag is now used by mp4 and cacheable upstream responses, thus allowing range requests of mp4 files with start/end, as well as range processing on a first request to a not-yet-cached files with proxy_cache. Notably this makes it possible to play mp4 files (with proxy_cache, or with mp4 module) on iOS devices, as byte-range support is required by Apple.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 21 Mar 2014 19:33:21 +0400
parents 4dee5ad51e9e
children 7022564a9e0e
comparison
equal deleted inserted replaced
5620:0a567878254b 5621:345e4fd4bb64
4181 #if (NGX_HTTP_CACHE) 4181 #if (NGX_HTTP_CACHE)
4182 4182
4183 if (r->cached) { 4183 if (r->cached) {
4184 r->allow_ranges = 1; 4184 r->allow_ranges = 1;
4185 return NGX_OK; 4185 return NGX_OK;
4186 4186 }
4187
4188 if (r->upstream->cacheable) {
4189 r->allow_ranges = 1;
4190 r->single_range = 1;
4191 return NGX_OK;
4187 } 4192 }
4188 4193
4189 #endif 4194 #endif
4190 4195
4191 ho = ngx_list_push(&r->headers_out.headers); 4196 ho = ngx_list_push(&r->headers_out.headers);