feat: add CacheWeave.Legacy for .NET Framework 4.8 support#12
Merged
Conversation
Handle Route Parameters
feat: add fault-tolerant cache I/O to Endpoint and Page filters
Add Prefix Key to the CacheKey
release: v1.0.6 — switch to MIT license and add NuGet package metadata
release: v1.0.7 — fix README rendering on nuget.org
Introduces a standalone CacheWeave.Legacy project that brings provider-agnostic caching to .NET Framework 4.8 without any ASP.NET Core dependencies. Included providers: - Redis (StackExchange.Redis) - InMemory (System.Runtime.Caching, in-box on net48) - DynamoDB (AWSSDK.DynamoDBv2) - SQLite (System.Data.SQLite.Core) - NCache (Alachisoft.NCache.SDK) Excluded (incompatible with net48): - Memcached (EnyimMemcachedCore is ASP.NET Core only) - FASTER KV (Microsoft.FASTER.Core v2 targets net6+) - DistributedCache (IDistributedCache is ASP.NET Core only) - All MVC/Razor Page/Minimal API filters Core services ported: - ICacheProvider / ICacheProviderInner abstractions - ICacheWeaveService + CacheWeaveService (programmatic API) - ICacheStampedeProtector + InProcessStampedeProtector - ICacheSerializer + System.Text.Json and Newtonsoft.Json impls - ICacheCompressor + GZipCacheCompressor - CompressingCacheProvider decorator - DisabledCacheProvider no-op - ServiceCollectionExtensions DI wiring Polyfill added for MaybeNullAttribute (internal in net48 BCL).
…gacy (net48) Tests (tests/CacheWeave.Legacy.Tests/, targets net48): - InMemoryCacheProvider: get/set/remove/expiry/prefix-not-supported - DisabledCacheProvider: all ops are no-ops, singleton check - GZipCacheCompressor: round-trip, large payload, empty string, JSON - CompressingCacheProvider: compress-on-set, decompress-on-get, passthrough remove - NewtonsoftJsonCacheSerializer: generic + typed round-trips - SystemTextJsonCacheSerializer: generic + typed round-trips, camelCase check - InProcessStampedeProtector: result, null, serialization, concurrency, exception - CacheWeaveService: GetOrSetAsync hit/miss/expiry/null-factory, GetAsync, SetAsync, InvalidateAsync, InvalidateByPrefixAsync, GlobalKeyPrefix, no-double-prefix - Uses FluentAssertions v6 (last version supporting net48), xunit, Moq CI (ci.yml): - Existing ubuntu-latest job now filters out CacheWeave.Legacy.Tests - New windows-latest job builds and runs CacheWeave.Legacy + tests on net48 Publish (publish-nuget.yml): - Moved from ubuntu-latest to windows-latest (required for net48 build/test) - Added CacheWeave.Legacy to PROJECTS pack list - Split test step: modern .NET (filtered) + net48 (explicit project) - Converted shell scripts to PowerShell README: - Added CacheWeave.Legacy row to Features table - Expanded Providers table with target framework column - Added dedicated .NET Framework 4.8 section with install, register, use examples, and provider capability matrix
The solution-level build on ubuntu-latest fails because net48 is not supported on Linux without Mono. Replace the solution build with an explicit per-project build loop covering only the modern .NET projects, and point the test step directly at CacheWeave.Tests.csproj. The windows-latest job continues to build and test CacheWeave.Legacy and CacheWeave.Legacy.Tests independently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
CacheWeave.Legacy— a self-contained package that brings provider-agnostic caching to .NET Framework 4.8 applications without any ASP.NET Core dependency.Changes
New project:
src/CacheWeave.Legacy/(net48)ICacheProvider,ICacheWeaveService,ICacheSerializer,ICacheCompressor,ICacheStampedeProtectorSystem.Runtime.Caching), SQLite (System.Data.SQLite.Core), DynamoDB, NCacheCacheWeaveService,InProcessStampedeProtectorCompressingCacheProviderdecoratorAddCacheWeave(),AddCacheWeaveRedis(),AddCacheWeaveInMemory(),AddCacheWeaveSQLite(),AddCacheWeaveDynamoDb(),AddCacheWeaveNCache()MaybeNullAttribute(internal in net48 BCL)New test project:
tests/CacheWeave.Legacy.Tests/(net48)InMemoryCacheProvider,DisabledCacheProvider,GZipCacheCompressor,CompressingCacheProvider,NewtonsoftJsonCacheSerializer,SystemTextJsonCacheSerializer,InProcessStampedeProtector,CacheWeaveServiceCI (
.github/workflows/ci.yml)ubuntu-latestjob filters outCacheWeave.Legacy.Tests(net48 requires Windows/Mono)windows-latestjob builds and runs net48 testsPublish (
.github/workflows/publish-nuget.yml)windows-latest(required for net48 build/test)CacheWeave.Legacyadded to the pack listDocumentation
README.md: net48 feature row, expanded providers table, dedicated .NET Framework 4.8 sectionHome.md,Getting-Started.md,Providers.md; newNet-Framework.mdpageWhat is NOT included (hard incompatibilities with net48)
[CacheWeave]/[CacheWeaveEvict]MVC attributes — ASP.NET Core onlySystem.Diagnostics.Metricsis .NET 6+ onlyEnyimMemcachedCoreis ASP.NET Core onlyMicrosoft.FASTER.Corev2 targets net6+ onlyIDistributedCacheis ASP.NET Core only