Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static files Cache-Control maxAge hardcode #137

Closed
SinaniG1996 opened this issue Sep 17, 2019 · 1 comment
Closed

Static files Cache-Control maxAge hardcode #137

SinaniG1996 opened this issue Sep 17, 2019 · 1 comment

Comments

@SinaniG1996
Copy link
Contributor

SinaniG1996 commented Sep 17, 2019

Hi. I have encountered on issue that i cant change Cache-Control maxage value for static files (e. g. .ico, .png). It seems this is because in lib/app:75 maxAge value hardcoded for such files.
Could you please move Cache ttl to config.
Something like this:

pluginOptions: {
    ssr: {
      ...
      // See https://ssr.vuejs.org/guide/build-config.html#externals-caveats
      nodeExternalsWhitelist: [/\.css$/, /\?vue&type=style/],
      // Static files Cache-Control maxAge value
      staticCacheTtl: 1000 * 60 * 60 * 24 * 30, <---------------
      // Function to connect custom middlewares
      extendServer: app => {
        const cookieParser = require('cookie-parser')
        app.use(cookieParser())
      },
      ...
  }
@SinaniG1996 SinaniG1996 changed the title Static files maxAge hardcode detected Static files Cache-Control maxAge hardcode Sep 17, 2019
@SinaniG1996
Copy link
Contributor Author

create pull request #138

Akryum pushed a commit that referenced this issue Oct 20, 2019
* Move Cache-Control maxAge to config

* Remove package-lock

* Update package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant