aliostad / CacheCow

An implementation of HTTP Caching in .NET Core and 4.5.2+ for both the client and the server
MIT License
847 stars 172 forks source link

use SqlStore in .net core #290

Closed Anushiravani closed 1 year ago

Anushiravani commented 1 year ago

hi i cant use sqlstore in .net core

        CacheCow.Client.SqlCacheStore.SqlStore sqlStore = new CacheCow.Client.SqlCacheStore.SqlStore("");

        var client2 = ClientExtensions.CreateClient(sqlStore);

        const string CacheableResource = "https://code.jquery.com/jquery-3.3.1.slim.min.js";
        var response = client2.GetAsync(CacheableResource).
              ConfigureAwait(false).GetAwaiter().GetResult();
        var responseFromCache = client2.GetAsync(CacheableResource).
              ConfigureAwait(false).GetAwaiter().GetResult();
        Console.WriteLine(response.Headers.GetCacheCowHeader().ToString()); // outputs "2.0.0.0;did-not-exist=true"
        Console.WriteLine(responseFromCache.Headers.GetCacheCowHeader().ToString()); // outputs "2.0.0.0;did-not-exist=false;retrieved-from-cache=true"

image

Severity Code Description Project File Line Suppression State Error CS7069 Reference to type 'ICacheMetadataProvider' claims it is defined in 'CacheCow.Client', but it could not be found

aliostad commented 1 year ago

Hi @Anushiravani

SqlStore is no longer supported. There are far better options for storage such as Redis, etc.

Can you please explain why you would want to use SQL Server?

Thanks

Anushiravani commented 1 year ago

I have a lot of problems installing and using Redis Cache on Windows Server 2019, so I wanted to have an easier way. As you know, it is very difficult to run Redis on Windows Server. Thank you for your answer