Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The cache works differently if the value of local-response-cache.enabled is default false or explicitly false #3377

Open
vicziani opened this issue Apr 27, 2024 · 0 comments

Comments

@vicziani
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant