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

Option for trailer etag #97

Open
2 tasks done
kurtextrem opened this issue Feb 8, 2023 · 2 comments
Open
2 tasks done

Option for trailer etag #97

kurtextrem opened this issue Feb 8, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@kurtextrem
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Add an option to set the etag header as trailer header instead of normal header.

Motivation

The fastify docs mention the etag header as an example for trailer headers: https://www.fastify.io/docs/latest/Reference/Reply/#trailerkey-function. So adding an option to making the etag header a trailer header inside of this fastify plugin might make sense.

However, I'm a little bit confused how a trailer etag is used by browsers. If the etag header is only sent after the body has been sent, what is the purpose of it? (e.g. status code can't change anymore, body transfer can't be skipped, ...). Maybe we should answer this first.

Example

No response

@mcollina
Copy link
Member

However, I'm a little bit confused how a trailer etag is used by browsers. If the etag header is only sent after the body has been sent, what is the purpose of it? (e.g. status code can't change anymore, body transfer can't be skipped, ...). Maybe we should answer this first.

The etag will be stored by the browser and sent again in the If-None-Match HTTP header when requesting the same resource twice.

@mcollina
Copy link
Member

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

@mcollina mcollina added the enhancement New feature or request label Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants