Conversation
| Ocelot currently supports caching on the URL of the downstream service and setting a TTL in seconds to expire the cache. | ||
| Users can also clear the cache for a specific region by using Ocelot's :ref:`administration-api`. | ||
|
|
||
| Ocelot utilizes some very rudimentary caching at the moment provider by the `CacheManager <https://github.com/MichaCo/CacheManager>`_ project. |
There was a problem hiding this comment.
This feels outdated despite the recent 2.0.0 release on March 6, 2025, which added support for the net8.0 TFM in the CacheManager.Core package. These pack dependencies were upgraded in release 24.0. Active development stopped back in 2018, seven years ago, and since then, only a single upgrade release was made on March 6 to accommodate .NET 8.
This library definitely needs a review of its capabilities. Considering a complete switch to Microsoft Cache libraries makes sense since the CacheManager GH-project is abandoned. Ocelot ranks first in the "Top Used By" list for CacheManager.Core and CacheManager.Microsoft.Extensions.Configuration, highlighting the lack of popularity and abandonment of the library.
Finally, it's better to rely on native Microsoft caching libraries and evolving ASP.NET Core approaches.
| Roadmap | ||
| ------- |
There was a problem hiding this comment.
The roadmap definitely needs a rewrite and update. A lot has happened in the ASP.NET industry over the last five years, making it a subject worth reviewing. However, it's not a pressing issue at the moment. Rewriting it would make more sense after the release of 24.1, during the development of version 25.0.
|
@raman-m i will review this tomorrow or saturday. From: RamanReviewing tomorrow works fine and fits the timeline. The PR will be more refined and solid by then. |
Development Complete ✅ |
raman-m
left a comment
There was a problem hiding this comment.
Ready for delivery ✅
- Code reviews ✔️ ✔️
- Unit testing ✔️
- Acceptance testing ✔️
- Updated documentation ✔️ ✔️
TODO tasks
|
Closes #2330
Proposed Changes
DefaultMemoryCache<T>that performs the same function as the legacyCacheManager. We should strictly use Microsoft's IMemoryCache and IDistributedCache interfaces moving forward →Logger.LogDebug()calls were still not removed, @RaynaldM 😄CacheOptionsin DynamicRoutesCreator.IsCachedproperty from DownstreamRoute and introduced a simpleUseCachehelper in CacheOptions. This refactoring eliminated a significant amount of unnecessary code.FileDynamicRoutewas left unchanged in favor of updating FileGlobalDynamicRouting.CacheOptionsproperty has been added to InternalConfiguration and its interface.CacheOptionsinto the context ofDownstreamRoutebusiness model.Ocelot/Cachenamespace, boosting total coverage by +0.3%. Take a look at the latest Coveralls build or Coveralls message for more details.