-
|
We're using Server Side Sessions in BFF v4 .AddEntityFrameworkServerSideSessions(options =>
{
options.UseSqlServer(
sqlServerOptions.ConnectionString,
sqlOptions => sqlOptions.MigrationsAssembly(typeof(Program).Assembly.GetName().Name)
);
})
.ConfigureEntityFrameworkSessionStoreOptions(options =>
{
options.DefaultSchema = "BFF";
})Reading https://docs.duendesoftware.com/bff/extensibility/tokens/ it seems that the access token is stored in the session Since we are using Server Side Sessions, does that mean that every request requires at least one call to our Sql Server database? Calls to that database are relatively expensive and our frontend app is chatty and makes lots of requests Ideally we would configure session-caching (with tokens) in memory. Even adding a short cache period of
Unforunately I think we could only user server side sessions if there is a caching feature, due to the performance impact, and we're keen to use (it is one of the features that we liked when choosing this product) Thanks very much |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Unfortunately, there is currently no mechanism built-in to enable a caching layer on top of the existing EF Core backed You can however provide a custom implementation for the |
Beta Was this translation helpful? Give feedback.
-
|
I solved this problem by creating a decorating class, wrapping memory cache around the UserSessionStore calls. |
Beta Was this translation helpful? Give feedback.
Unfortunately, there is currently no mechanism built-in to enable a caching layer on top of the existing EF Core backed
UserSessionStore.If you disable server-side sessions, then the cookies would indeed contain the access token again, but you would also lose the ability to revoke sessions when the user signs out (or is signed out) from the identity provider. Adding a caching layer would also increase the risk for a session to still be valid (in the cache) while it should've already been revoked.
You can however provide a custom implementation for the
IUserSessionStoreinterface which adds a caching layer on top of a SQL-backed store.