fiber icon indicating copy to clipboard operation
fiber copied to clipboard

🤗 [Question]: Question on ETag Docs

Open kirankumar-grootan opened this issue 1 year ago • 1 comments

Question Description

As per doc you can utilize Etag as middleware, and there's also an option to enable it in fiber.config.

https://docs.gofiber.io/api/middleware/etag/ https://docs.gofiber.io/api/fiber

Are the functionalities the same when enabling via fiber.config or middleware? What's the distinction between the two methods?

Code Snippet (optional)

No response

Checklist:

  • [X] I agree to follow Fiber's Code of Conduct.
  • [X] I have checked for existing issues that describe my questions prior to opening this one.
  • [X] I understand that improperly formatted questions may be closed without explanation.

kirankumar-grootan avatar Apr 25 '24 14:04 kirankumar-grootan

@kirankumar-grootan the setting in the app was there before we had the middleware and afterwards we couldn't remove it because it would have caused a breaking change.

in v3 this setting has been removed and you are supposed to use the middleware.

the difference is that the app setting affects all routes and with the middleware you could only apply the etag procedure to certain routes.

ReneWerner87 avatar Apr 26 '24 06:04 ReneWerner87