question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

missing vary header for preCompressed files

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mcollinacommented, Aug 11, 2021

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

0reactions
Uzlopakcommented, Jul 17, 2022

Probably connected with #300

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best practices for using the Vary header | Fastly
Vary is one of the most powerful HTTP response headers. However, if used incorrectly, it can cause problems for developers.
Read more >
Serving Pre-Compressed Files with Apache MultiViews
This post describes how to serve pre-compressed files, such as gzipped CSS and ... Sending an incorrect or missing Content-Encoding header.
Read more >
How to serve pre-compressed files with Caddy v2 - Help
I would like to know how to serve pre-compressed files with Caddy v2. ... If I change to the correct header Content-Encoding: gzip ......
Read more >
Content-Encoding not displayed in Response header when ...
Header append Content-Encoding gzip # Force proxies to cache gzipped & # non-gzipped css/js files separately. Header append Vary Accept-Encoding ...
Read more >
Apache serve compressed/uncompressed files depending on ...
If the client cannot handle compressed content the server will find the the .gz file, decompress it, change the headers accordingly and then ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found