{"id":15132554,"url":"https://github.com/cynegeirus/cache-manager","last_synced_at":"2026-01-19T00:33:21.317Z","repository":{"id":255217048,"uuid":"848898665","full_name":"cynegeirus/cache-manager","owner":"cynegeirus","description":"Generic Cache Manager Application is a simple ASP.NET Core Web API project that uses Redis for caching. This project demonstrates how to use Redis as a caching layer in a web application, providing basic CRUD operations on the cache.","archived":false,"fork":false,"pushed_at":"2024-08-28T15:57:45.000Z","size":2089,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T21:43:20.416Z","etag":null,"topics":["cache","cache-control","cache-service","cachemanager","redis","redis-cache","redis-client","redis-database","redis-server"],"latest_commit_sha":null,"homepage":"","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/cynegeirus.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T15:55:48.000Z","updated_at":"2024-10-22T18:07:30.000Z","dependencies_parsed_at":"2024-08-28T17:39:47.284Z","dependency_job_id":"565c386a-e3cf-4c6b-88d7-04d0f274625f","html_url":"https://github.com/cynegeirus/cache-manager","commit_stats":null,"previous_names":["cynegeirus/cache-manager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cynegeirus/cache-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynegeirus%2Fcache-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynegeirus%2Fcache-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynegeirus%2Fcache-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynegeirus%2Fcache-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cynegeirus","download_url":"https://codeload.github.com/cynegeirus/cache-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynegeirus%2Fcache-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28554394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T23:48:35.235Z","status":"ssl_error","status_checked_at":"2026-01-18T23:47:49.178Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cache","cache-control","cache-service","cachemanager","redis","redis-cache","redis-client","redis-database","redis-server"],"created_at":"2024-09-26T04:20:48.100Z","updated_at":"2026-01-19T00:33:21.301Z","avatar_url":"https://github.com/cynegeirus.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generic Cache Manager Application\n\nGeneric Cache Manager Application is a simple ASP.NET Core Web API project that uses Redis for caching. This project demonstrates how to use Redis as a caching layer in a web application, providing basic CRUD operations on the cache.\n\n## Features\n\n- Get a cached item by key\n- Get all cached items\n- Add a new item to the cache\n- Delete an item from the cache by key\n- Delete all items from the cache\n\n## Prerequisites\n\n- [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)\n- [Docker](https://www.docker.com/products/docker-desktop) (for running Redis)\n- [Redis](https://redis.io/download)\n\n## Getting Started\n\n### Setting up Redis\n\nTo run Redis locally using Docker, execute the following command:\n\n```sh\ndocker run --name redis -d -p 6379:6379 redis\n```\n\n### Configuration\n\nEnsure your `appsettings.json` is configured to connect to your Redis instance. The connection string should look something like this:\n\n```json\n{\n  \"ConnectionStrings\": {\n    \"Redis\": \"localhost:6379\"\n  }\n}\n```\n\n### Installing Dependencies\n\nNavigate to the project directory and restore the dependencies:\n\n```sh\ndotnet restore\n```\n\n### Running the Application\n\nTo run the application, use the following command:\n\n```sh\ndotnet run\n```\n\nThe API will be available at `https://localhost:5001`.\n\n## API Endpoints\n\n### Get Item by Key\n\n- **URL:** `GET /api/Redis/Get`\n- **Parameters:** `key` (string) - The key of the cached item\n- **Response:** A JSON object containing the cached item\n\n```sh\ncurl -X GET \"https://localhost:5001/api/Redis/Get?key=YOUR_CACHE_KEY\"\n```\n\n### Get All Items\n\n- **URL:** `GET /api/Redis/GetAll`\n- **Response:** A JSON array containing all cached items\n\n```sh\ncurl -X GET \"https://localhost:5001/api/Redis/GetAll\"\n```\n\n### Add Item\n\n- **URL:** `POST /api/Redis/Add`\n- **Body:**\n\n```json\n{\n  \"key\": \"yourKey\",\n  \"value\": \"yourValue\"\n}\n```\n\n- **Response:** A JSON object indicating success or failure\n\n```sh\ncurl -X POST \"https://localhost:5001/api/Redis/Add\" -H \"Content-Type: application/json\" -d '{\"key\":\"YOUR_CACHE_KEY\",\"value\":\"YOUR_CACHE_VALUE}'\n```\n\n### Delete Item by Key\n\n- **URL:** `POST /api/Redis/Delete`\n- **Parameters:** `key` (string) - The key of the cached item to delete\n- **Response:** A JSON object indicating success or failure\n\n```sh\ncurl -X POST \"https://localhost:5001/api/Redis/Delete?key=YOUR_CACHE_KEY\"\n```\n\n### Delete All Items\n\n- **URL:** `POST /api/Redis/DeleteAll`\n- **Response:** A JSON object indicating success or failure\n\n```sh\ncurl -X POST \"https://localhost:5001/api/Redis/DeleteAll\"\n```\n\n## Project Structure\n\n- **Controllers**\n  - `RedisController.cs` - Handles API requests for cache operations\n- **Models**\n  - `CacheItemModel.cs` - Represents a cache item\n  - `CacheResponseModel.cs` - Represents the response model for cache operations\n- **Services**\n  - **Abstract**\n    - `IGlobalCacheService.cs` - Interface for cache service\n  - **Concrete**\n    - `RedisCacheService.cs` - Implementation of the cache service using Redis\n\n## Constants\n\n- **Messages.cs** - Contains constant messages used in responses\n\n## Example Response Models\n\n### CacheResponseModel\n\nRepresents a general response model for cache operations.\n\n```csharp\npublic class CacheResponseModel\n{\n    public bool Success { get; set; }\n    public string Message { get; set; }\n}\n\npublic class CacheResponseModel\u003cT\u003e : CacheResponseModel\n{\n    public string Machine { get; set; }\n    public List\u003cCacheItemModel\u003cT\u003e\u003e Items { get; set; } = new List\u003cCacheItemModel\u003cT\u003e\u003e();\n}\n```\n\n### CacheItemModel\n\nRepresents a cache item.\n\n```csharp\npublic class CacheItemModel\u003cT\u003e\n{\n    public string Key { get; set; }\n    public T Value { get; set; }\n    public DateTimeOffset Expiration { get; set; }\n}\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE). See the license file for details.\n\n## Issues, Feature Requests or Support\n\nPlease use the Issue \u003e New Issue button to submit issues, feature requests or support issues directly to me. You can also send an e-mail to akin.bicer@outlook.com.tr.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcynegeirus%2Fcache-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcynegeirus%2Fcache-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcynegeirus%2Fcache-manager/lists"}