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

Open
#3,377 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
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:

  • hello is cached
  • hello-name is not cached

When the property is false:

  • IllegalArgumentException - Unable to find GatewayFilterFactory with name LocalResponseCache

When the property is true:

  • hello is cached
  • hello-name is 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.