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

feat(server): allow disabling serve-static middleware entirely #9365

Merged
merged 1 commit into from Jun 2, 2021

Conversation

danielroe
Copy link
Member

Types of changes

  • New feature (a non-breaking change which adds functionality)

Description

Allows explicitly disabling serve-static middleware by setting render.static to false.

closes #9362

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

Copy link
Member

@clarkdo clarkdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antoinerey
Copy link
Contributor

Should we also disable the second serve-static middleware instance defined a bit later in the code (https://github.com/nuxt/nuxt.js/pull/9365/files#diff-b8c2d26ed3fd075596a838c69b36c537536ae6973cafffdbf481fec464c9b6cfR104-R110)?

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pi0
Copy link
Member

pi0 commented Jun 2, 2021

@antoinerey Ideally users shouldn't hit /_nuxt/ requests and reverse proxy should cache/handle them.

@pi0 pi0 merged commit 40521d0 into dev Jun 2, 2021
@pi0 pi0 deleted the feat/allow-disabling-serve-static branch June 2, 2021 13:03
Copy link

@Matausi29 Matausi29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not bad

@pi0
Copy link
Member

pi0 commented Jun 2, 2021

TODO:

@antoinerey
Copy link
Contributor

👋 By any chance, any update about when this will be released?

@pi0
Copy link
Member

pi0 commented Jul 29, 2021

Hi @antoinerey there is no specific time but you can use nuxt-edge package to get the feature

@antoinerey
Copy link
Contributor

Thanks for the prompt answer!

I'm not sure we want to move from the stable channel to the edge one, so we'll probably work on our patience skill. 😁

@pi0 pi0 mentioned this pull request Aug 11, 2021
danielroe added a commit to nuxt/website-v2 that referenced this pull request Sep 21, 2021
@danielroe danielroe added the 2.x label Jan 18, 2023
@danielroe danielroe mentioned this pull request Jan 19, 2023
@danielroe danielroe mentioned this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server-static middleware generating a lot of file system access while it should not
5 participants