{"id":19665920,"url":"https://github.com/amphp/http-client-cache","last_synced_at":"2025-08-21T08:16:24.228Z","repository":{"id":56947388,"uuid":"194733044","full_name":"amphp/http-client-cache","owner":"amphp","description":"An async HTTP cache for Amp's HTTP client.","archived":false,"fork":false,"pushed_at":"2024-03-19T19:16:14.000Z","size":86,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"2.x","last_synced_at":"2025-07-06T05:19:43.429Z","etag":null,"topics":["amphp","async","http-cache","http-client","php","rfc-7234"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/amphp.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":"2019-07-01T19:39:14.000Z","updated_at":"2025-06-24T02:05:51.000Z","dependencies_parsed_at":"2024-11-11T16:36:58.925Z","dependency_job_id":null,"html_url":"https://github.com/amphp/http-client-cache","commit_stats":{"total_commits":60,"total_committers":3,"mean_commits":20.0,"dds":"0.16666666666666663","last_synced_commit":"8babbf6945e9c5603743b811ad5f6add88041923"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/amphp/http-client-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-client-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-client-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-client-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-client-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amphp","download_url":"https://codeload.github.com/amphp/http-client-cache/tar.gz/refs/heads/2.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-client-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271448405,"owners_count":24761441,"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-21T02:00:08.990Z","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":["amphp","async","http-cache","http-client","php","rfc-7234"],"created_at":"2024-11-11T16:25:28.217Z","updated_at":"2025-08-21T08:16:24.205Z","avatar_url":"https://github.com/amphp.png","language":"PHP","readme":"# http-client-cache\n\n![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)\n\nThis package provides an HTTP cache in form of an `ApplicationInterceptor` for [Amp's HTTP client](https://github.com/amphp/http-client) based on [RFC 7234](https://tools.ietf.org/html/rfc7234.html).\n\n## Features\n\n - Private cache (`SingleUserCache`)\n - Automatic `vary` header support\n - Caching pushed responses\n\n## Planned Features\n\n - Shared cache\n - Conditional requests\n\n## Installation\n\nThis package can be installed as a [Composer](https://getcomposer.org/) dependency.\n\n```bash\ncomposer require amphp/http-client-cache\n```\n\n## Usage\n\nCurrently, only a `SingleUserCache` is provided.\nTherefore, it is unsafe to use a single instance for multiple users, e.g. different access tokens.\n\n```php\nuse Amp\\Cache\\FileCache;\nuse Amp\\Http\\Client\\HttpClientBuilder;\nuse Amp\\Http\\Client\\Cache\\SingleUserCache;\nuse Amp\\Sync\\LocalKeyedMutex;\n\n$cache = new FileCache(__DIR__, new LocalKeyedMutex);\n\n$client = (new HttpClientBuilder)\n    -\u003eintercept(new SingleUserCache($cache, $logger))\n    -\u003ebuild();\n```\n\n## Examples\n\nMore extensive code examples reside in the [`examples`](./examples) directory.\n\n## Versioning\n\n`amphp/http-client-cache` follows the [semver](http://semver.org/) semantic versioning specification like all other `amphp` packages.\n\n## Security\n\nIf you discover any security related issues, please email [`me@kelunik.com`](mailto:me@kelunik.com) instead of using the issue tracker.\n\n## License\n\nThe MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information.\n","funding_links":[],"categories":["HTTP"],"sub_categories":["Client"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famphp%2Fhttp-client-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famphp%2Fhttp-client-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famphp%2Fhttp-client-cache/lists"}