Finbuckle / Finbuckle.MultiTenant

Finbuckle.MultiTenant is an open-source multitenancy middleware library for .NET. It enables tenant resolution, per-tenant app behavior, and per-tenant data isolation.
https://www.finbuckle.com/multitenant
Apache License 2.0
1.26k stars 258 forks source link

Possibilities on Optimizing Http Remote Request #847

Open kesavan-m-19 opened 1 week ago

kesavan-m-19 commented 1 week ago

Hi @AndrewTriesToCode ,

I am using below modules in FinBuckle,

  1. Strategy - Delegate Strategy - To get tenant identifier from the request URL
  2. Store - Http Remote Store - To get tenant details via API of an another service

While implementation I have noticed that for every incoming requests API call was initiated to get tenant details. But I am expecting as, once tenant details was retrieved it needs to be reused for upcoming requests, instead of initiating another API call for getting same tenant details.

Can you confirm,

Please share your suggestion on this requirement. Thanks in advance.

AndrewTriesToCode commented 4 days ago

Hi, you can register a cache store before the httpremote store and it'll first check the cache, if it doesn't find it, then it will add check the http store. You can configure it with the events that when a hit is found on the http remote store that it be added to the cache store. See #673 for a good solution.