VOOZH about

URL: https://www.nuget.org/packages/MyCSharp.HttpUserAgentParser.MemoryCache/

⇱ NuGet Gallery | MyCSharp.HttpUserAgentParser.MemoryCache 3.1.6




👁 Image
MyCSharp.HttpUserAgentParser.MemoryCache 3.1.6

Requires NuGet 2.12 or higher.

dotnet add package MyCSharp.HttpUserAgentParser.MemoryCache --version 3.1.6
 
 
NuGet\Install-Package MyCSharp.HttpUserAgentParser.MemoryCache -Version 3.1.6
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MyCSharp.HttpUserAgentParser.MemoryCache" Version="3.1.6" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MyCSharp.HttpUserAgentParser.MemoryCache" Version="3.1.6" />
 
Directory.Packages.props
<PackageReference Include="MyCSharp.HttpUserAgentParser.MemoryCache" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MyCSharp.HttpUserAgentParser.MemoryCache --version 3.1.6
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MyCSharp.HttpUserAgentParser.MemoryCache, 3.1.6"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MyCSharp.HttpUserAgentParser.MemoryCache@3.1.6
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MyCSharp.HttpUserAgentParser.MemoryCache&version=3.1.6
 
Install as a Cake Addin
#tool nuget:?package=MyCSharp.HttpUserAgentParser.MemoryCache&version=3.1.6
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

MyCSharp.HttpUserAgentParser.MemoryCache

IMemoryCache-based caching provider for MyCSharp.HttpUserAgentParser.

Repository: https://github.com/mycsharp/HttpUserAgentParser

Install

dotnet add package MyCSharp.HttpUserAgentParser.MemoryCache

Quick start

Register the provider:

services.AddHttpUserAgentMemoryCachedParser();

Then inject IHttpUserAgentParserProvider:

public sealed class MyService(IHttpUserAgentParserProvider parser)
{
	public HttpUserAgentInformation Parse(string userAgent) => parser.Parse(userAgent);

Configure cache

services.AddHttpUserAgentMemoryCachedParser(options =>
{
	options.CacheEntryOptions.SlidingExpiration = TimeSpan.FromMinutes(60); // default is 1 day
	options.CacheOptions.SizeLimit = 1024; // default is null (= no limit)
});

Notes:

  • Each unique user-agent string counts as one cache entry.
  • The provider is registered as singleton and owns its internal MemoryCache instance.
  • Like any cache, concurrent requests for a new key can race; counters are best-effort.

Telemetry (EventCounters)

Telemetry is modular and opt-in.

Enable (Fluent API)

services
	.AddHttpUserAgentMemoryCachedParser()
	.WithMemoryCacheTelemetry();

Optionally enable core counters too:

services
	.AddHttpUserAgentMemoryCachedParser()
	.WithTelemetry()
	.WithMemoryCacheTelemetry();

EventSource + counters

EventSource: MyCSharp.HttpUserAgentParser.MemoryCache (constant: HttpUserAgentParserMemoryCacheEventSource.EventSourceName)

  • user_agent_parser.cache.hit (incrementing)
  • user_agent_parser.cache.miss (incrementing)
  • user_agent_parser.cache.size (polling)

Monitor with dotnet-counters

dotnet-counters monitor --process-id <pid> MyCSharp.HttpUserAgentParser.MemoryCache

Telemetry (native Meters)

This package can also emit native System.Diagnostics.Metrics instruments.

Enable meters (Fluent API)

services
	.AddHttpUserAgentMemoryCachedParser()
	.WithMemoryCacheMeterTelemetry();

Optionally enable core meters too:

services
	.AddHttpUserAgentMemoryCachedParser()
	.WithMeterTelemetry()
	.WithMemoryCacheMeterTelemetry();

Meter + instruments

Meter: MyCSharp.HttpUserAgentParser.MemoryCache (constant: HttpUserAgentParserMemoryCacheMeters.MeterName)

  • user_agent_parser.cache.hit (counter)
  • user_agent_parser.cache.miss (counter)
  • user_agent_parser.cache.size (observable gauge)

Export to OpenTelemetry / Application Insights

You can collect these counters with OpenTelemetry’s EventCounters instrumentation.

Add the EventSource name:

using OpenTelemetry.Metrics;

metrics.AddEventCountersInstrumentation(options =>
{
	options.AddEventSources(HttpUserAgentParserMemoryCacheEventSource.EventSourceName);
});

From there you can export to:

  • OTLP (Collector)
  • Prometheus
  • Azure Monitor / Application Insights (via an Azure Monitor exporter)

Export native meters to OpenTelemetry

If you enabled native meters (see above), collect them via AddMeter(...):

using OpenTelemetry.Metrics;
using MyCSharp.HttpUserAgentParser.MemoryCache.Telemetry;

metrics.AddMeter(HttpUserAgentParserMemoryCacheMeters.MeterName);

Application Insights listener registration

If you prefer a direct listener instead of OpenTelemetry, you can attach an EventListener and forward values into Application Insights.

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MyCSharp.HttpUserAgentParser.MemoryCache:

Package Downloads
Zoo.GenericApp.Logic

Базовая логика для для приложения на Croco, включена поддержка Clt, Ecc, Doc, Js-Open-Api. Содержатся основные Background сервисы необходимые для работы веб-приложения.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on MyCSharp.HttpUserAgentParser.MemoryCache:

Repository Stars
AscensionGameDev/Intersect-Engine
Intersect provides a complete game development suite for creating 2d mmorpgs with no programming experience required!
Version Downloads Last Updated
3.1.6 6,514 4/1/2026
3.1.3 1,991 3/5/2026
3.0.28 43,870 8/25/2025
3.0.27 196 8/23/2025
3.0.25 20,100 4/26/2025
3.0.23 982 4/12/2025
3.0.21-gd594614d04 265 3/31/2025
3.0.20-g7795a06d24 270 3/20/2025
3.0.19-g3452a5347c 186 3/15/2025
3.0.18-gbf6637cea6 243 3/2/2025
3.0.13 7,661 2/25/2025
3.0.13-g9ebf55cc61 197 2/25/2025
3.0.12 256 2/25/2025
3.0.12-g2db20cc097 186 1/25/2025
3.0.11 4,086 1/25/2025
3.0.11-gd806c9c385 162 1/14/2025
3.0.10 443 1/14/2025
3.0.9 51,648 11/12/2024
1.0.0 116 2/19/2026
Loading failed