mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-27 21:14:26 +00:00
Also set proper maxAge headers for static files
Files in the /static dir seem to not have the proper expire headers
This commit is contained in:
parent
6d969b0e37
commit
1a3f386627
@ -90,7 +90,9 @@ class Nuxt {
|
||||
// renderer used by Vue.js (via createBundleRenderer)
|
||||
this.renderer = null
|
||||
// For serving static/ files to /
|
||||
this.serveStatic = pify(serveStatic(resolve(this.srcDir, 'static')))
|
||||
this.serveStatic = pify(serveStatic(resolve(this.srcDir, 'static'), {
|
||||
maxAge: (this.dev ? 0 : '1y') // 1 year in production
|
||||
}))
|
||||
// For serving .nuxt/dist/ files (only when build.publicPath is not an URL)
|
||||
this.serveStaticNuxt = pify(serveStatic(resolve(this.dir, '.nuxt', 'dist'), {
|
||||
maxAge: (this.dev ? 0 : '1y') // 1 year in production
|
||||
|
Loading…
Reference in New Issue
Block a user