You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: