mirror of
https://github.com/expressjs/expressjs.com.git
synced 2026-02-21 19:41:33 +00:00
docs(express.static): add accept-ranges and cache-control options to express.static (#2089)
Co-authored-by: Akash-2006 <skumar169@lenovo.com> Co-authored-by: efekrskl <8130264+efekrskl@users.noreply.github.com> Co-authored-by: bjohansebas <103585995+bjohansebas@users.noreply.github.com>
This commit is contained in:
@@ -30,6 +30,8 @@ See also the [example below](#example.of.express.static).
|
||||
| `maxAge` | Set the max-age property of the Cache-Control header in milliseconds or a string in [ms format](https://www.npmjs.org/package/ms). | Number | 0 |
|
||||
| `redirect` | Redirect to trailing "/" when the pathname is a directory. | Boolean | `true` |
|
||||
| `setHeaders` | Function for setting HTTP headers to serve with the file. <br/><br/>See [setHeaders](#setHeaders) below. | Function | |
|
||||
| `acceptRanges` | Enable or disable accepting ranged requests. Disabling this will not send the `Accept-Ranges` header and will ignore the contents of the Range request header.| Boolean | true |
|
||||
| `cacheControl` | Enable or disable setting the `Cache-Control` response header. Disabling this will ignore the immutable and maxAge options. | Boolean | true |
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ See also the [example below](#example.of.express.static).
|
||||
| `maxAge` | Set the max-age property of the Cache-Control header in milliseconds or a string in [ms format](https://www.npmjs.org/package/ms). | Number | 0 |
|
||||
| `redirect` | Redirect to trailing "/" when the pathname is a directory. | Boolean | `true` |
|
||||
| `setHeaders` | Function for setting HTTP headers to serve with the file. <br/><br/>See [setHeaders](#setHeaders) below. | Function | |
|
||||
| `acceptRanges` | Enable or disable accepting ranged requests. Disabling this will not send the Accept-Ranges header and will ignore the contents of the Range request header.| Boolean | true |
|
||||
| `cacheControl` | Enable or disable setting the Cache-Control response header. Disabling this will ignore the immutable and maxAge options. | Boolean | true |
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user