spring-cloud / spring-cloud/spring-cloud-gateway
The cache works differently if the value of local-response-cache.enabled is default false or explicitly false
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
When the value of the spring.cloud.gateway.filter.local-response-cache.enabled property is false, the application
doesn't start as the documentation mentions. But if this property is missing, the application starts. The documentation
says, the false is the default value.
Sample application with integration tests: https://github.com/vicziani/spring-cloud-gateway-bug
https://docs.spring.io/spring-cloud-gateway/reference/4.1-SNAPSHOT/appendix.html#page-title
The current documentation gives "404 - Not found status now".
https://docs.spring.io/spring-cloud-gateway/reference/current/index.html
I have two routes:
routes:
- id: hello
uri: http://localhost:8080
predicates:
- Path=/api/hello
filters:
- LocalResponseCache=30m,500MB
- id: hello-name
uri: http://localhost:8080
predicates:
- Path=/api/hello/{name}
When the property is missing:
hellois cachedhello-nameis not cached
When the property is false:
IllegalArgumentException-Unable to find GatewayFilterFactory with name LocalResponseCache
When the property is true:
hellois cachedhello-nameis cached (default cache)
Yet another question: what is the difference between spring.cloud.gateway.filter.local-response-cache.enabled and
spring.cloud.gateway.global-filter.local-response-cache.enabled property?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked sample application and its integration tests, then trace the spring.cloud.gateway.filter.local-response-cache.enabled and spring.cloud.gateway.global-filter.local-response-cache.enabled entry points. Compare the missing, false, and true configurations with the LocalResponseCache routes and the referenced documentation; done means the behavior and documented property semantics agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend, documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100