arut at nginx.com
Thu Feb 18 17:14:18 UTC 2016
On Wed, Feb 17, 2016 at 09:20:37AM +0000, Martijn Berkvens wrote:
> First off, thank you for the work on the slice module. We’re currently using a lua implementation to achieve something similar but this has its shortcomings and we would prefer to use this module.
> We’ve been testing this module and when using range requests it works as expected, but when doing normal requests (without a request range) the module still slices the content when the configured slice size is met resulting in corrupt data as it will only serve out the configured slice size and not the entire requested file.
Module slices all requests, whether they have Range header or not.
This lets nginx reuse already cached slices.
Please describe in detail what exactly is corrupted and show your
configuration. Nothing should be corrupted when using the slice module, the
entire file should be assembled of slices and sent to client once you
configured nginx correctly.
> We run into these issues because a server or location configuration within nginx would service both normal requests as range requests and we have files exceeding the slice size in both cases.
> Ideally the slice module would only do its magic when a request contains $http_range. We’ve tried creating a map which would set the slice size to 0 (to disable slicing) when no $http_range is present, but unfortunately the slice directive currently does not support variables.
> For our use case it would most likely be sufficient to add variable support to the slice directive. It is understood and acceptable that we would have duplicate cached content in cases where we have both the sliced versions of the file as the entire file.
You can have that by adding another location for files cached as a whole
and rewriting your request to that location when $http_range is empty.
More information about the nginx-devel