{"id":22683104,"url":"https://github.com/davguij/angular-http-cache","last_synced_at":"2025-10-27T20:15:21.183Z","repository":{"id":57310685,"uuid":"80316137","full_name":"davguij/angular-http-cache","owner":"davguij","description":"Speed up your remote requests by automatically caching them on client and add support for offline navigation.","archived":false,"fork":false,"pushed_at":"2017-02-07T14:58:49.000Z","size":10,"stargazers_count":25,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-25T07:11:15.639Z","etag":null,"topics":["angular2","local","offline","offline-first","requests"],"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/davguij.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":"2017-01-28T22:51:02.000Z","updated_at":"2020-12-04T00:14:46.000Z","dependencies_parsed_at":"2022-08-26T04:50:49.640Z","dependency_job_id":null,"html_url":"https://github.com/davguij/angular-http-cache","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/davguij/angular-http-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davguij%2Fangular-http-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davguij%2Fangular-http-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davguij%2Fangular-http-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davguij%2Fangular-http-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davguij","download_url":"https://codeload.github.com/davguij/angular-http-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davguij%2Fangular-http-cache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268448175,"owners_count":24251994,"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-08-02T02:00:12.353Z","response_time":74,"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":["angular2","local","offline","offline-first","requests"],"created_at":"2024-12-09T21:10:08.874Z","updated_at":"2025-10-27T20:15:16.149Z","avatar_url":"https://github.com/davguij.png","language":"TypeScript","readme":"# Angular HTTP Cache\n\n## What's this?\n\nThis project adds an \"offline-first\" approach to the regular Http service. Responses are saved to local persistence and then served from there on subsequent requests.\n\n### How does it work?\n\nBasically, the module uses its own extended Http replacement service to save the response to every request into the browser's local persistence.\n\nSo for every request, the service will first look for a matching response in its local persistence; if it exists, it will emit that response first.\n\nRegardless of the previous step, the service will perform the HTTP request and will emit updated data if necessary.\n\n## How to use it?\n\nThe module is a replacement for the native `HttpModule`, so it's intended to be easy to be dropped in.\n\nIts methods are identical to the native module.\n\nThe code works fine with JSON-formatted HTTP responses. It can be also used for other types of responses, such as images, but __it hasn't been properly tested yet__, so please use with caution.\n\n### Installing it\n\n```\nnpm install ng-http-cache --save\n```\n\n### Importing it\n\n```js\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\n\nimport { HttpCacheModule } from 'ng-http-cache';\n\n@NgModule({\n  imports: [\n    BrowserModule,\n    HttpCacheModule\n  ]\n})\nexport class ExampleModule { }\n```\n\n### Using it\n\n```js\nimport { Http } from '@angular/http';\nexport class ExampleComponent implements OnInit {\n  constructor(private http: Http) { }\n\n  ngOnInit() {\n    this.http.get('http://api.example.com/example')\n\t  // There's no need to 'map' the response, the service does it for you!\n      .subscribe((resp) =\u003e { \n        console.log(resp);\n      });\n  }\n}\n```\n\n## More stuff\n\n### Get in touch\n\nFeel free to drop me a line if you have an issue, doubt, problem or suggestion, even just to tell me what you think. You can leave an issue here or give me a shout on [Twitter](http://twitter.com/davguij).\n\n### To-do\n1) Check the network status and don't make the request if offline.\n2) Include unit tests.\n3) Add JSONP support.\n\n### License\n\nMIT\n","funding_links":[],"categories":["Awesome Angular [![Awesome TipeIO](https://img.shields.io/badge/Awesome%20Angular-@TipeIO-6C6AE7.svg)](https://github.com/gdi2290/awesome-angular) [![Awesome devarchy.com](https://img.shields.io/badge/Awesome%20Angular-@devarchy.com-86BDC1.svg)](https://github.com/brillout/awesome-angular-components)"],"sub_categories":["Angular \u003ca id=\"angular\"\u003e\u003c/a\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavguij%2Fangular-http-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavguij%2Fangular-http-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavguij%2Fangular-http-cache/lists"}