mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-21 23:12:56 +00:00
* ✨ Cache middleware: Store e2e headers. As defined in RFC2616 - section-13.5.1, shared caches MUST store end-to-end headers from backend response and MUST be transmitted in any response formed from a cache entry. This commit ensures a stronger consistency between responses served from the handlers & from the cache middleware. * ✨ Cache middleware: Add flag for e2e headers. Set flag to prevent e2e headers caching to be the default behavior of the cache middleware. This would otherwise change quite a lot the experience for cache middleware current users. * ✨ Cache middleware: Add Benchmark for additionalHeaders feature. * ✨ Cache middleware: Rename E2Eheaders into StoreResponseHeaders. E2E is an acronym commonly associated with test. While in the present case it refers to end-to-end HTTP headers (by opposition to hop-by-hop), this still remains confusing. This commits renames it to a more generic name. * ✨ Cache middleware: Update README * ✨ Cache middleware: Move map instanciation. This will prevent an extra memory allocation for users not interested in this feature. * ✨ Cache middleware: Prevent memory allocation when StoreResponseHeaders is disabled. * ✨ Cache middleware: Store e2e headers. #1807 - use set instead of add for the headers - copy value from the headers -> prevent problems with mutable values Co-authored-by: wernerr <rene@gofiber.io>