{"id":21328415,"url":"https://github.com/wiredviews/kentico-fluent-cache-keys","last_synced_at":"2025-08-20T22:41:17.112Z","repository":{"id":65364239,"uuid":"205297631","full_name":"wiredviews/kentico-fluent-cache-keys","owner":"wiredviews","description":"Utility library for generating consistent cache dependency keys for Kentico CMS applications","archived":false,"fork":false,"pushed_at":"2024-09-03T22:17:30.000Z","size":69,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T23:41:13.999Z","etag":null,"topics":["kentico-cms-applications","kentico-ems"],"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/wiredviews.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":"2019-08-30T03:29:00.000Z","updated_at":"2022-12-01T23:41:48.000Z","dependencies_parsed_at":"2023-02-11T06:35:20.380Z","dependency_job_id":null,"html_url":"https://github.com/wiredviews/kentico-fluent-cache-keys","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/wiredviews/kentico-fluent-cache-keys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fkentico-fluent-cache-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fkentico-fluent-cache-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fkentico-fluent-cache-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fkentico-fluent-cache-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiredviews","download_url":"https://codeload.github.com/wiredviews/kentico-fluent-cache-keys/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fkentico-fluent-cache-keys/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958135,"owners_count":23689006,"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","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":["kentico-cms-applications","kentico-ems"],"created_at":"2024-11-21T21:28:52.058Z","updated_at":"2025-07-12T07:31:55.053Z","avatar_url":"https://github.com/wiredviews.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kentico Fluent Cache Keys\n\nUtility library for generating consistent cache dependency keys for Kentico Xperience applications\n\n[![GitHub Actions CI: Build](https://github.com/wiredviews/kentico-fluent-cache-keys/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/wiredviews/kentico-fluent-cache-keys/actions/workflows/ci.yml)\n\n[![Publish Packages to NuGet](https://github.com/wiredviews/kentico-fluent-cache-keys/actions/workflows/publish.yml/badge.svg?branch=main)](https://github.com/wiredviews/kentico-fluent-cache-keys/actions/workflows/publish.yml)\n\n## Packages\n\n[![NuGet Package](https://img.shields.io/nuget/v/WiredViews.Kentico.FluentCacheKeys.svg)](https://www.nuget.org/packages/WiredViews.Kentico.FluentCacheKeys)\n\n## How to Use?\n\n1. Install the `WiredViews.Kentico.FluentCacheKeys` [NuGet](https://www.nuget.org/packages/WiredViews.Kentico.FluentCacheKeys/) package in your project:\n\n   ```bash\n   dotnet add package WiredViews.Kentico.FluentCacheKeys\n   ```\n\n## Examples\n\n### Creating cache keys for pages / documents / nodes\n\n```csharp\nFluentCacheKey.ForPage().WithDocumentId(5);\n\nFluentCacheKey.ForPage().WithNodeId(4);\n\nFluentCacheKey.ForPage().RelationshipsOfNodeId(4);\n\nFluentCacheKey.ForPage().OfSite(\"Sandbox\").WithAliasPath(\"/home\");\n\nFluentCacheKey.ForPage().OfSite(\"Sandbox\").WithAliasPath(\"/home\", \"en-us\");\n\nFluentCacheKey.ForPages().OfSite(\"Sandbox\").OfClassName(HomePage.CLASS_NAME);\n\nFluentCacheKey.ForPages().OfSite(\"Sandbox\").UnderAliasPath(\"/home\");\n\nFluentCacheKey.ForPagesNodeOrder().All();\n```\n\n### Creating cache keys for CMS objects / custom module classes\n\n```csharp\nFluentCacheKey.ForObject().OfClassName(UserInfo.OBJECT_TYPE).WithName(\"administrator\");\n\nFluentCacheKey.ForObject().OfClassName(UserInfo.OBJECT_TYPE).WithGuid(new Guid(\"9fb0c012-5d9b-4eb6-b5cd-0bb0daffaca0\"));\n\nFluentCacheKey.ForObject().OfClassName(UserInfo.OBJECT_TYPE).WithId(2);\n\nFluentCacheKey.ForObjects().OfClassName(UserInfo.OBJECT_TYPE).All();\n```\n\n### Creating cache keys for attachments\n\n```csharp\nFluentCacheKey.ForAttachment().WithGuid(new Guid(\"9fb0c012-5d9b-4eb6-b5cd-0bb0daffaca0\"));\n\nFluentCacheKey.ForAttachments().OfDocumentId(4);\n\nFluentCacheKey.ForAttachments().All();\n```\n\n### Creating cache keys for media files\n\n```csharp\nFluentCacheKey.ForMediaFile().WithGuid(new Guid(\"9fb0c012-5d9b-4eb6-b5cd-0bb0daffaca0\"));\n\nFluentCacheKey.ForMediaFile().PreviewWithGuid(new Guid(\"9fb0c012-5d9b-4eb6-b5cd-0bb0daffaca0\"));\n```\n\n### Creating cache keys for custom tables\n\n```csharp\nFluentCacheKey.ForCustomTable().OfClassName(\"MyCustomTable\").All();\n\nFluentCacheKey.ForCustomTable().OfClassName(\"MyCustomTable\").WithRecordId(5);\n```\n\n### Creating cache keys for settings\n\n```csharp\nFluentCacheKey.ForSetting().WithCodeName(\"settingKeyName\");\n\nFluentCacheKey.ForSetting().OfSiteId(1).WithCodeName(\"settingKeyName\");\n```\n\n## Contributions\n\nIf you discover a problem, please [open an issue](https://github.com/wiredviews/kentico-fluent-cache-keys/issues/new).\n\nIf you would like contribute to the code or documentation, please [open a pull request](https://github.com/wiredviews/kentico-fluent-cache-keys/compare).\n\n## References\n\n### Kentico Documentation\n\n- [Setting cache dependencies](https://docs.kentico.com/k12sp/configuring-kentico/configuring-caching/setting-cache-dependencies) for cache dependency key examples.\n\n- [Caching in custom code](https://docs.kentico.com/k12sp/configuring-kentico/configuring-caching/caching-in-custom-code) for examples of how to use these keys.\n\n### Blog Posts\n\n- [Kentico 12: Design Patterns Part 12 - Database Query Caching Patterns](https://dev.to/seangwright/kentico-12-design-patterns-part-12-database-query-caching-patterns-43hc) for best practices for caching in your application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiredviews%2Fkentico-fluent-cache-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiredviews%2Fkentico-fluent-cache-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiredviews%2Fkentico-fluent-cache-keys/lists"}