You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started.md
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ running as a Container or as a Systemd service.
32
32
|`DNS_RESOLVERS`| No ||| DNS resolvers (separated by single spaces) to configure NGINX with |
33
33
|`PROXY_CACHE_MAX_SIZE`| No ||`10g`| Limits cache size |
34
34
| `PROXY_CACHE_INACTIVE` | No | | `60m` | Cached data that are not accessed during the time specified by the parameter get removed from the cache regardless of their freshness
35
-
|`PROXY_CACHE_SLICE_SIZE`| No ||`1m`| For requests with a `Range` header included, determines the size of the chunks in which the file is fetched. Values much smaller than the requests can lead to inefficiencies due to reading and writing many files ||
35
+
|`PROXY_CACHE_SLICE_SIZE`| No ||`1m`| For requests with a `Range` header included, determines the size of the chunks in which the file is fetched. Values much smaller than the requests can lead to inefficiencies due to reading and writing many files. See [below for more details](#byte-range-requests-and-caching)||
36
36
|`PROXY_CACHE_VALID_OK`| No ||`1h`| Sets caching time for response code 200 and 302 |
37
37
|`PROXY_CACHE_VALID_NOTFOUND`| No ||`1m`| Sets caching time for response code 404 |
38
38
|`PROXY_CACHE_VALID_FORBIDDEN`| No ||`30s`| Sets caching time for response code 403 |
@@ -113,6 +113,17 @@ S3 bucket in a subfolder on an ALB. For example, if you wanted to expose the
113
113
root of a bucket under the path "www.mysite.com/somepath", you would set this
114
114
variable to "/somepath".
115
115
116
+
## Byte-Range Requests and Caching
117
+
The gateway caches [byte-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests) (requests sent with a `Range` header) requests differently than normal requests.
118
+
119
+
The gateway is configured to cache such requests in chunks of size `PROXY_CACHE_SLICE_SIZE`. If you don't provide this configuration value it will default to 1 megabyte.
120
+
121
+
This means that if you request 2.5 megabytes of a 1 gigabyte file, the gateway will cache 3 megabytes and nothing else.
122
+
123
+
Setting your slice size too small can have performance impacts since NGINX performs a subrequest for each slice. For more details see the [official reference](http://nginx.org/en/docs/http/ngx_http_slice_module.html).
124
+
125
+
You may make byte-range requests and normal requests for the same file and NGINX will automatically handle them differently. The caches for file chunks and normal file requests are separate on disk.
126
+
116
127
## Running as a Systemd Service
117
128
118
129
An [install script](/standalone_ubuntu_oss_install.sh) for the gateway shows
0 commit comments