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
* Add "etag" response header
Utilize the `etag` module on npm to send an "etag" response header.
* Revert "Add "etag" response header"
This reverts commit 3c20819.
* Update README with `etag` option
* Implement sha1 etags
* Remove extra newline
* Strong ETag and always send Last-Modified
* Cast mtime to number
* Make Last-Modified be either/or again
* Document that it's a strong etag
|[`public`](#public-string)| Set a sub directory to be served |
53
+
|[`cleanUrls`](#cleanurls-booleanarray)| Have the `.html` extension stripped from paths |
54
+
|[`rewrites`](#rewrites-array)| Rewrite paths to different paths |
55
+
|[`redirects`](#redirects-array)| Forward paths to different paths or external URLs |
56
+
|[`headers`](#headers-array)| Set custom headers for specific paths |
57
+
|[`directoryListing`](#directorylisting-booleanarray)| Disable directory listing or restrict it to certain paths |
58
+
|[`unlisted`](#unlisted-array)| Exclude paths from the directory listing |
59
+
|[`trailingSlash`](#trailingslash-boolean)| Remove or add trailing slashes to all paths |
60
+
|[`renderSingle`](#rendersingle-boolean)| If a directory only contains one file, render it |
61
+
|[`symlinks`](#symlinks-boolean)| Resolve symlinks instead of rendering a 404 error |
62
+
|[`etag`](#etag-boolean)| Calculate a strong `ETag` response header, instead of `Last-Modified`|
62
63
63
64
### public (String)
64
65
@@ -274,6 +275,18 @@ However, this behavior can easily be adjusted:
274
275
275
276
Once this property is set as shown above, all symlinks will automatically be resolved to their targets.
276
277
278
+
### etag (Boolean)
279
+
280
+
HTTP response headers will contain a strong [`ETag`][etag] response header, instead of a [`Last-Modified`][last-modified] header. Opt-in because calculating the hash value may be computationally expensive for large files.
281
+
282
+
Sending an `ETag` header is disabled by default and can be enabled like this:
283
+
284
+
```js
285
+
{
286
+
"etag":true
287
+
}
288
+
```
289
+
277
290
## Error templates
278
291
279
292
The handler will automatically determine the right error format if one occurs and then sends it to the client in that format.
@@ -317,3 +330,7 @@ Since it comes with support for `serve-handler` out of the box, you can create a
317
330
## Author
318
331
319
332
Leo Lamprecht ([@notquiteleo](https://twitter.com/notquiteleo)) - [ZEIT](https://zeit.co)
0 commit comments