-
Notifications
You must be signed in to change notification settings - Fork 2
Caching with SQL Server
Peter Chapman edited this page Apr 2, 2021
·
8 revisions
The GoTo.Bible application supports caching of provider API calls using Microsoft SQL Server, MySQL, or In-Memory Caching.
CREATE TABLE [dbo].[Cache](
[Id] [nvarchar](449) NOT NULL,
[Value] [varbinary](max) NOT NULL,
[ExpiresAtTime] [datetimeoffset](7) NOT NULL,
[SlidingExpirationInSeconds] [bigint] NULL,
[AbsoluteExpiration] [datetimeoffset](7) NULL,
PRIMARY KEY CLUSTERED ([Id]) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
The following configuration can be using with SQL LocalDB, assuming you have already created a database called GoToBible:
dotnet user-secrets set "Providers:Cache:DatabaseProvider" "mssql"
dotnet user-secrets set "Providers:Cache:ConnectionString" "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=GoToBible;Integrated Security=True;"
dotnet user-secrets set "Providers:Cache:SchemaName" "dbo"
dotnet user-secrets set "Providers:Cache:TableName" "Cache"