gofiber / fiber

⚡️ Express inspired web framework written in Go

Home Page:https://gofiber.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🤗 [Question]: Question on ETag Docs

kirankumar-grootan opened this issue · 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:

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

@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.