Caching ClaimsPrincipal during authentication and re-caching FileConfiguration objects in Consul and Disk File configuration repos#1249
Conversation
|
Hi Mohsen! What issue is this PR related to? |
|
@EngRajabi commented on May 30, 2020:
In comparison to what performance indicators was the current performance improved? |
|
I was in an enterprise project that used the reference token type. I had a performance problem. Because in every request, it needs to request the identity of the server. The problem was solved with this cache. |
Did you use Service Discovery + Identity Server setup, or classic setup + Identity Server Bearer Tokens? |
|
Unfortunately there are no builds for these commits! |
cd5675c to
0561ad5
Compare
src/Ocelot/Configuration/Repository/DiskFileConfigurationRepository.cs
Outdated
Show resolved
Hide resolved
c216cdf to
b458f0f
Compare
908d84f to
0678e7a
Compare
Why use cache in authentication middleware? That’s a risky approach for the official Ocelot repo. In my opinion, there should be no caching for authentication. Feel free to handle it however you like in your forked repo.
Authentication doesn’t take much time if the provider isn’t a remote system. With a local library, the authentication process completes in just a few CPU cycles, so there’s no need to cache the
The
Really? First, prove this by sharing the complete solution on GitHub ❗ |
Regarding So, caching FileConfiguration isn’t necessary. Even if the Administration feature is used to update the ocelot.json file through the Administration API, ASP.NET configuration provider handles this at runtime, updating the object in DI, and the current state can be read from the IOptionsMonitor<FileConfiguration> service.
@RaynaldM @ggnaegi |
New Feature
Cache response access token
Motivation for New Feature