Skip to content

feat: add CacheWeave.Legacy for .NET Framework 4.8 support#12

Merged
teghoz merged 8 commits into
developfrom
feature/net48-legacy-support
Jun 3, 2026
Merged

feat: add CacheWeave.Legacy for .NET Framework 4.8 support#12
teghoz merged 8 commits into
developfrom
feature/net48-legacy-support

Conversation

@teghoz

@teghoz teghoz commented Jun 2, 2026

Copy link
Copy Markdown
Owner

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)

  • Core abstractions: ICacheProvider, ICacheWeaveService, ICacheSerializer, ICacheCompressor, ICacheStampedeProtector
  • Providers: Redis, InMemory (System.Runtime.Caching), SQLite (System.Data.SQLite.Core), DynamoDB, NCache
  • Services: CacheWeaveService, InProcessStampedeProtector
  • Serializers: System.Text.Json, Newtonsoft.Json
  • Compression: GZip via CompressingCacheProvider decorator
  • DI extensions: AddCacheWeave(), AddCacheWeaveRedis(), AddCacheWeaveInMemory(), AddCacheWeaveSQLite(), AddCacheWeaveDynamoDb(), AddCacheWeaveNCache()
  • Polyfill for MaybeNullAttribute (internal in net48 BCL)

New test project: tests/CacheWeave.Legacy.Tests/ (net48)

  • xunit + Moq + FluentAssertions v6 (last version supporting net48)
  • 8 test classes: InMemoryCacheProvider, DisabledCacheProvider, GZipCacheCompressor, CompressingCacheProvider, NewtonsoftJsonCacheSerializer, SystemTextJsonCacheSerializer, InProcessStampedeProtector, CacheWeaveService

CI (.github/workflows/ci.yml)

  • Existing ubuntu-latest job filters out CacheWeave.Legacy.Tests (net48 requires Windows/Mono)
  • New windows-latest job builds and runs net48 tests

Publish (.github/workflows/publish-nuget.yml)

  • Moved to windows-latest (required for net48 build/test)
  • CacheWeave.Legacy added to the pack list
  • Shell scripts converted to PowerShell

Documentation

  • README.md: net48 feature row, expanded providers table, dedicated .NET Framework 4.8 section
  • Wiki: updated Home.md, Getting-Started.md, Providers.md; new Net-Framework.md page

What is NOT included (hard incompatibilities with net48)

  • [CacheWeave] / [CacheWeaveEvict] MVC attributes — ASP.NET Core only
  • Razor Page and Minimal API filters — ASP.NET Core only
  • OpenTelemetry metrics/traces — System.Diagnostics.Metrics is .NET 6+ only
  • Memcached — EnyimMemcachedCore is ASP.NET Core only
  • FASTER KV — Microsoft.FASTER.Core v2 targets net6+ only
  • DistributedCache wrapper — IDistributedCache is ASP.NET Core only

teghoz added 7 commits May 12, 2026 13:18
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
@teghoz teghoz self-assigned this Jun 3, 2026
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.
@teghoz teghoz merged commit 5b4e145 into develop Jun 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant