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

missing vary header for preCompressed files #230

Open
2 tasks done
moonmeister opened this issue Aug 11, 2021 · 6 comments
Open
2 tasks done

missing vary header for preCompressed files #230

moonmeister opened this issue Aug 11, 2021 · 6 comments
Labels
good first issue Good for newcomers semver-minor Issue or PR that should land as semver minor

Comments

@moonmeister
Copy link

moonmeister commented Aug 11, 2021

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure it has not already been reported

Fastify version

3.19.0

Plugin version

4.2.0

Node.js version

14.x

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

11.15.1

Description

The Vary Header is not included when serving preCompressed assets. This can cause issues with caches serving the incorrect version of pages to browsers.

Steps to Reproduce

Serve preCompressed assets and check the header response in devtools and you'll see no vary: content-encoding header present.

Expected Behavior

I'd expect the vary: content-encoding header to be served with all assets. This applies whether or not they werepreCompressed and whether or not the compressed version is served. The MDN article for vary also notes some other times it should be included, like with 304 responses.

related

#158

@mcollina
Copy link
Member

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@moonmeister
Copy link
Author

Should be possible.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@moonmeister
Copy link
Author

Still needs doing.

@stale stale bot removed the stale label Apr 16, 2022
@mcollina mcollina added good first issue Good for newcomers semver-minor Issue or PR that should land as semver minor labels Apr 17, 2022
@Uzlopak
Copy link
Contributor

Uzlopak commented Jul 17, 2022

Probably connected with #300

@gurgunday
Copy link
Member

(Obvious) Note: The header is present when static is combined with compress

Note 2: accept-encoding is used more than content-encoding as Vary header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers semver-minor Issue or PR that should land as semver minor
Projects
None yet
Development

No branches or pull requests

4 participants