spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Rework LocalResponseCache into a general ResponseCache to support Caffiene and Redis CacheManagers

Open JesseEstum opened this issue 2 years ago • 4 comments

LocalResponseCacheGatewayFilterFactory offers a lot of great functionality assuming that you're fine with a Caffiene-backed cache implementation. For my particular use case, I'm interested in using a Redis cache and distributing the cache storage across several instances of the spring-cloud-gateway app.

This pull request:

  1. renames parts of the plumbing that are common regardless of caching implementation from LocalResponseCache* to ResponseCache*
  2. adds auto configuration for Redis-backed CacheManager
  3. changes the access modifiers of some classes/methods in order to make my use case work out

Any feedback/suggestions are appreciated. If modifications are required in order to get this back into the mainline please let me know.

JesseEstum avatar Nov 21 '23 21:11 JesseEstum

Anything we do at this point needs to be backwards compatible. We don't do breaking changes, for the most part, unless it's a major release and we will not be doing one for a while.

spencergibb avatar Nov 22 '23 20:11 spencergibb

@spencergibb that makes sense. I'm willing to work on shuffling this around into a non-breaking PR.

Breaking changes aside - Do you have any feedback on the idea behind the PR? Is there appetite for inclusion of a pluggable cache implementation for response caching?

JesseEstum avatar Nov 22 '23 21:11 JesseEstum

I think it makes sense, but it would need to be reworked. No rush.

spencergibb avatar Nov 22 '23 21:11 spencergibb

Any chance you can rebase? No rush, this would be part of our 2024.0 release train.

spencergibb avatar Mar 08 '24 18:03 spencergibb