It seems not currently seem possible.
The only available option in nuxt.config.js is:
render: {
etag: {
weak: false
}
}
see doc: https://nuxtjs.org/api/configuration-render#etag (default: true)
see source code: https://github.com/nuxt/nuxt.js/blob/72300d350ef6c3087fd1a3d1c4480e4d02932281/lib/common/options.js#L323 (default: false)
Possible indeed. Just set etag option to false in nuxt.config.js
render: {
etag: false
}
Update:
Locally tested. As the result, it only disables eTag header for SSR responses. For resources served with serve-static including static/* and /_nuxt/* the middleware generates a weak etag using file timestamp by default. (So won't affect perf)
Update 2
Configuration below, will disable it for SSR and _nuxt:
render: {
etag: false,
static: {
etag: false
}
}
@pi0 Thanks. I did some mistake. After second try it works 馃憤
Is it possible to do the same for .js files?
@awronski Yes. See my edited comment. It is only impossible to disable for static/ content. (Which there is no reason to do)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Possible indeed. Just set
etagoption tofalseinnuxt.config.jssource: https://github.com/nuxt/nuxt.js/blob/72300d350ef6c3087fd1a3d1c4480e4d02932281/lib/core/middleware/nuxt.js#L30
Update:
Locally tested. As the result, it only disables eTag header for
SSRresponses. For resources served with serve-static includingstatic/*and/_nuxt/*the middleware generates a weak etag using file timestamp by default. (So won't affect perf)Update 2
Configuration below, will disable it for
SSRand_nuxt: