{"id":31213804,"url":"https://github.com/bitfaster/bitfaster.caching.dependencyinjection","last_synced_at":"2025-09-21T08:47:15.305Z","repository":{"id":60588109,"uuid":"543800518","full_name":"bitfaster/BitFaster.Caching.DependencyInjection","owner":"bitfaster","description":"Extension methods for setting up caches using Microsoft.Extensions.DependencyInjection.","archived":false,"fork":false,"pushed_at":"2023-09-04T12:08:19.000Z","size":61,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-24T10:16:04.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitfaster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-30T21:42:15.000Z","updated_at":"2025-06-29T10:50:51.000Z","dependencies_parsed_at":"2023-02-10T03:05:22.442Z","dependency_job_id":null,"html_url":"https://github.com/bitfaster/BitFaster.Caching.DependencyInjection","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bitfaster/BitFaster.Caching.DependencyInjection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfaster%2FBitFaster.Caching.DependencyInjection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfaster%2FBitFaster.Caching.DependencyInjection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfaster%2FBitFaster.Caching.DependencyInjection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfaster%2FBitFaster.Caching.DependencyInjection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfaster","download_url":"https://codeload.github.com/bitfaster/BitFaster.Caching.DependencyInjection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfaster%2FBitFaster.Caching.DependencyInjection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276216329,"owners_count":25604726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-21T08:47:13.890Z","updated_at":"2025-09-21T08:47:15.300Z","avatar_url":"https://github.com/bitfaster.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BitFaster.Caching.DependencyInjection\nExtension methods for setting up [caches](https://github.com/bitfaster/BitFaster.Caching/wiki/Caches) using [Microsoft.Extensions.DependencyInjection](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection/).\n\n[![NuGet version](https://badge.fury.io/nu/BitFaster.Caching.DependencyInjection.svg)](https://badge.fury.io/nu/BitFaster.Caching.DependencyInjection)\n![Nuget](https://img.shields.io/nuget/dt/BitFaster.Caching.DependencyInjection)\n![.NET Core](https://github.com/bitfaster/BitFaster.Caching.DependencyInjection/actions/workflows/gate.yml/badge.svg?main)\n[![Coverage Status](https://coveralls.io/repos/github/bitfaster/BitFaster.Caching.DependencyInjection/badge.svg?branch=main)](https://coveralls.io/github/bitfaster/BitFaster.Caching.DependencyInjection?branch=main)\n\n# ConcurrentLru\n\nTo use with an `IServiceCollection` instance at startup:\n\n```cs\nservices.AddLru\u003cint, string\u003e(builder =\u003e\n    builder\n        .WithCapacity(666)\n        .Build());\n```\n\nThis adds a `ConcurrentLru` where the key is an integer and the cached value is a string. The builder delegate is used to configure the registered cache with a capacity of 666, see the [wiki](https://github.com/bitfaster/BitFaster.Caching/wiki/ConcurrentLru-Quickstart#builder-api) for more details about the builder API and configurable cache features.\n\nThere is an extension method for each [cache interface](https://github.com/bitfaster/BitFaster.Caching/wiki/Caches):\n\n| Extension | Result | \n|-----------|--------|\n| `AddLru\u003cTKey, TValue\u003e` | Registers `ConcurrentLru\u003cTKey, TValue\u003e` as a singleton `ICache\u003cTKey, TValue\u003e` |\n| `AddAsyncLru\u003cTKey, TValue\u003e` | Registers `ConcurrentLru\u003cTKey, TValue\u003e` as a singleton `IAsyncCache\u003cTKey, TValue\u003e` |\n| `AddScopedLru\u003cTKey, TValue\u003e` | Registers `ConcurrentLru\u003cTKey, TValue\u003e` as a singleton `IScopedCache\u003cTKey, TValue\u003e` |\n| `AddScopedAsyncLru\u003cTKey, TValue\u003e` | Registers `ConcurrentLru\u003cTKey, TValue\u003e` as a singleton `IScopedAsyncCache\u003cTKey, TValue\u003e` |\n\n\n# ConcurrentLfu\n\nTo use with an `IServiceCollection` instance at startup:\n\n```cs\nservices.AddLfu\u003cint, string\u003e(builder =\u003e\n    builder\n        .WithCapacity(666)\n        .Build());\n```\n\nThis adds a `ConcurrentLfu` where the key is an integer and the cached value is a string. The builder delegate is used to configure the registered cache with a capacity of 666, see the [wiki](https://github.com/bitfaster/BitFaster.Caching/wiki/ConcurrentLfu-Quickstart#builder-api) for more details about the builder API and configurable cache features.\n\nThere is an extension method for each [cache interface](https://github.com/bitfaster/BitFaster.Caching/wiki/Caches):\n\n| Extension | Result | \n|-----------|--------|\n| `AddLfu\u003cTKey, TValue\u003e` | Registers `ConcurrentLfu\u003cTKey, TValue\u003e` as a singleton `ICache\u003cTKey, TValue\u003e` |\n| `AddAsyncLfu\u003cTKey, TValue\u003e` | Registers `ConcurrentLfu\u003cTKey, TValue\u003e` as a singleton `IAsyncCache\u003cTKey, TValue\u003e` |\n| `AddScopedLfu\u003cTKey, TValue\u003e` | Registers `ConcurrentLfu\u003cTKey, TValue\u003e` as a singleton `IScopedCache\u003cTKey, TValue\u003e` |\n| `AddScopedAsyncLfu\u003cTKey, TValue\u003e` | Registers `ConcurrentLfu\u003cTKey, TValue\u003e` as a singleton `IScopedAsyncCache\u003cTKey, TValue\u003e` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfaster%2Fbitfaster.caching.dependencyinjection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfaster%2Fbitfaster.caching.dependencyinjection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfaster%2Fbitfaster.caching.dependencyinjection/lists"}