-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Describe the bug
The normal 'Cache-Control' header that is generated in a response by Spring WebMVC when configured to enable default cache controls contains the value "no-cache, no-store, max-age=0, must-revalidate". Spring Cloud Gateway's LocalResponseCache filtering mechanism doesn't check this value correctly and will apply default cache values to the response rather than skipping caching.
It also appears as if when a WebMVC explicitly specifies the max-age
in its ResponseEntity, that Spring Cloud Gateway also ignores this value and uses its own.
Sample
I've created a sample repo with an application and Gateway that show this behavior.
https://github.com/danielshiplett/scg-error
I am also creating a PR that will show a possible fix. However, it caused several other tests to fail. This makes me think that either I am on the wrong track, or this was a major oversight that ended leading to invalid tests. Please let me know which.