{"id":48708385,"url":"https://github.com/Suleeyman/ngx-lite-cache","last_synced_at":"2026-04-13T11:01:11.839Z","repository":{"id":347162610,"uuid":"1192870089","full_name":"Suleeyman/ngx-lite-cache","owner":"Suleeyman","description":"A lightweight, simple HTTP caching library for Angular applications. This library provides an easy way to cache HTTP responses using Angular's HttpClient interceptors, reducing unnecessary network requests and improving application performance.","archived":false,"fork":false,"pushed_at":"2026-03-26T21:48:10.000Z","size":90,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T09:41:02.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Suleeyman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"ko_fi":"ysuleyman"}},"created_at":"2026-03-26T16:35:43.000Z","updated_at":"2026-03-27T00:01:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Suleeyman/ngx-lite-cache","commit_stats":null,"previous_names":["suleeyman/ngx-lite-cache"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Suleeyman/ngx-lite-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suleeyman%2Fngx-lite-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suleeyman%2Fngx-lite-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suleeyman%2Fngx-lite-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suleeyman%2Fngx-lite-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Suleeyman","download_url":"https://codeload.github.com/Suleeyman/ngx-lite-cache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suleeyman%2Fngx-lite-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31749763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"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":[],"created_at":"2026-04-11T13:00:21.199Z","updated_at":"2026-04-13T11:01:11.833Z","avatar_url":"https://github.com/Suleeyman.png","language":"TypeScript","readme":"# NgxLiteCache\n\nA lightweight, simple HTTP caching library for Angular applications. This library provides an easy way to cache HTTP responses using Angular's HttpClient interceptors, reducing unnecessary network requests and improving application performance.\n\n## Features\n\n- 🚀 **Simple Integration**: Easy to integrate with existing Angular applications\n- ⚡ **Performance Boost**: Cache HTTP responses to reduce network requests\n- 🎯 **Selective Caching**: Control which requests to cache using HttpContext\n- 🔄 **Cache Invalidation**: Support for cache invalidation when needed\n- 📦 **Lightweight**: Minimal dependencies, focused on HTTP caching\n- 🔧 **TypeScript**: Full TypeScript support with proper typing\n\n## Installation\n\n```bash\nnpm install ngx-lite-cache\n```\n\n## Quick Start\n\n### 1. Configure HttpClient with the Cache Interceptor\n\nIn your `app.config.ts`:\n\n```typescript\nimport { ApplicationConfig } from '@angular/core';\nimport { provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { cacheInterceptor } from 'ngx-lite-cache';\n\nexport const appConfig: ApplicationConfig = {\n  providers: [\n    provideHttpClient(withInterceptors([cacheInterceptor])),\n    // ... other providers\n  ],\n};\n```\n\n### 2. Use HttpContext to Cache Requests\n\n```typescript\nimport { HttpClient, HttpContext } from '@angular/common/http';\nimport { CACHING_ENTRY } from 'ngx-lite-cache';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class ApiService {\n  constructor(private http: HttpClient) {}\n\n  getPosts() {\n    return this.http.get('/api/posts', {\n      context: new HttpContext().set(CACHING_ENTRY, 'posts'),\n    });\n  }\n}\n```\n\n## API Reference\n\n### HttpContext Tokens\n\n- `CACHING_ENTRY`: Set a cache key for the request\n- `CACHING_INVALIDATE`: Invalidate a specific cache entry\n\n## Usage Examples\n\n### Caching GET request\n\n```typescript\nimport { HttpClient, HttpContext } from '@angular/common/http';\nimport { CACHING_ENTRY } from 'ngx-lite-cache';\n\ngetUserProfile(userId: string) {\n  return this.http.get(`/api/users/${userId}`, {\n    context: new HttpContext().set(CACHING_ENTRY, `/users/${userId}`),\n  });\n}\n```\n\n### Cache Invalidation\n\n```typescript\nimport { HttpClient, HttpContext } from '@angular/common/http';\nimport { CACHING_ENTRY, CACHING_INVALIDATE } from 'ngx-lite-cache';\n\nupdateUserProfile(userId: string, data: any) {\n  return this.http.put(`/api/users/${userId}`, data, {\n    context: new HttpContext()\n      .set(CACHING_INVALIDATE, `/users/${userId}`), // Invalidate the cached profile after the request is *ok*\n  });\n}\n```\n\n## Development\n\nThis project uses Angular CLI for development. The workspace contains both the library (`projects/ngx-lite-cache`) and a demo application (`projects/app`).\n\n### Prerequisites\n\n- Node.js\n- npm or yarn\n\n### Setup\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/Suleeyman/ngx-lite-cache.git\ncd ngx-lite-cache\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n### Development Server\n\nRun the demo application:\n\n```bash\nnpm start\n```\n\nNavigate to `http://localhost:4200/` to see the demo in action.\n\n### Building the Library\n\n```bash\nng build ngx-lite-cache\n```\n\nThe build artifacts will be stored in the `dist/ngx-lite-cache/` directory.\n\n### Running Tests\n\n```bash\nng test ngx-lite-cache\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the project\n2. Create your feature branch (`git checkout -b feature/my-feature`)\n3. Commit your changes (`git commit -m 'Add some feature'`)\n4. Push to the branch (`git push origin feature/my-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 💬 Feedback\n\nHave suggestions, feedback, or need support? Open an issue or start a discussion — we’d love to hear from you.\n\n## Contribution\n\nWe welcome all kinds of contributions!\n\n**♥️ Financial support**\n\nIf you want to support me financially you can [buy me a coffee](https://ko-fi.com/ysuleyman) it will certainly motivate me on improving that library\n","funding_links":["https://ko-fi.com/ysuleyman"],"categories":["Architecture and Advanced Topics"],"sub_categories":["HTTP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuleeyman%2Fngx-lite-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSuleeyman%2Fngx-lite-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuleeyman%2Fngx-lite-cache/lists"}