Skip to content

Commit

Permalink
Document that etag function can be customized
Browse files Browse the repository at this point in the history
Basically added the PR description as the documentation, hope that's ok.

Closes nuxt#1625.
  • Loading branch information
studnitz authored Oct 20, 2019
1 parent 6971040 commit e6f3d5f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions en/api/configuration-render.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,23 @@ To disable etag for pages set `etag: false`

See [etag](https://www.npmjs.com/package/etag) docs for possible options.

You can specify your own hash function by specifying `etag.hash`:

`nuxt.config.js`
```js
import { murmurHash128 } from 'murmurhash-native'

export default {
render: {
etag: {
hash: html => murmurHash128(html)
}
}
}
```

In this case we use [murmurhash-native](https://github.com/royaltm/node-murmurhash-native), which is faster for larger html body sizes. Note that the `weak` option is ignored, when specifying your own hash function.

## compressor

- Type `Object`
Expand Down

0 comments on commit e6f3d5f

Please sign in to comment.