* Add an option to invalidate cache
* Add a summary about the cache middleware update
* Rename the option to make it clearer
* Rename hard tab
* Fix markdown formatting
* Revert unnecessary change
* Clarify the description of cache invalidator
* Add empty line
---------
Co-authored-by: RW <rene@gofiber.io>
From the Go docs:
"If the map is nil, the number of iterations is 0." [1]
Therefore, an additional nil check for before the loop is unnecessary.
[1]: https://go.dev/ref/spec#For_range
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* internal: revert linting changes
Changes to the internal package should not have been made in 167a8b5e94.
* middleware/monitor: revert changes to exported field "ChartJSURL"
This is a breaking change introduced in 167a8b5e94.
* middleware/monitor: fix error checking
Fix the errorenous error checking introduced in 167a8b5e94.
* 🐛 Bug: Fix issues introduced in linting PR #2319
* 🐛 Bug: Fix issues introduced in linting PR #2319
* Bug: Fix issues introduced in linting PR #2319
---------
Co-authored-by: René Werner <rene@gofiber.io>
* golangci-lint: add and apply more stricter linting rules
* github: drop security workflow now that we use gosec linter inside golangci-lint
* github: use official golangci-lint CI linter
* Add editorconfig and gitattributes file
* 🐛 Fix: Expiration time in cache middleware
* Custom expiration time using ExpirationGenerator is also functional
now instead of default Expiration only
* 🚨 Improve Test_CustomExpiration
* - stabilization of the tests
- speed up the cache tests
- fix race conditions in client and client tests
Co-authored-by: wernerr <rene@gofiber.io>
* ✨ 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>
* added HEAD method to caching
* changed key due to head and get sharing same key
* Update cache.go
- add a improvement task for later
* Update cache.go
correct comment
Co-authored-by: Jesse Quinn <jesse.quinn@zpesystems.com>
Co-authored-by: RW <rene@gofiber.io>
* add cache header to show cache status
* update default CacheHeader to X-Cache
* add CacheHeader test
* Update cache_test.go
use constants in test
Co-authored-by: RW <rene@gofiber.io>