{"id":26018609,"url":"https://github.com/pardnchiu/php-cache","last_synced_at":"2025-03-06T06:32:01.602Z","repository":{"id":275490822,"uuid":"926218230","full_name":"pardnchiu/PHP-Cache","owner":"pardnchiu","description":"PD\\Cache is a hybrid caching system for PHP that combines Redis and filesystem caching with automatic filesystem fallback support.","archived":false,"fork":false,"pushed_at":"2025-02-03T08:29:04.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T06:46:12.922Z","etag":null,"topics":["cache","pardnchiu","pardnio","pardnltd","php-composer","php-library"],"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/pardnchiu.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":"2025-02-02T20:27:45.000Z","updated_at":"2025-02-03T05:33:46.000Z","dependencies_parsed_at":"2025-02-02T22:19:10.432Z","dependency_job_id":"19a13161-e2af-439a-b0d9-b842024b7bd7","html_url":"https://github.com/pardnchiu/PHP-Cache","commit_stats":null,"previous_names":["pardnchiu/php-cache"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardnchiu%2FPHP-Cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardnchiu%2FPHP-Cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardnchiu%2FPHP-Cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardnchiu%2FPHP-Cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pardnchiu","download_url":"https://codeload.github.com/pardnchiu/PHP-Cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242161547,"owners_count":20081892,"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":["cache","pardnchiu","pardnio","pardnltd","php-composer","php-library"],"created_at":"2025-03-06T06:31:12.379Z","updated_at":"2025-03-06T06:32:01.586Z","avatar_url":"https://github.com/pardnchiu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PD\\Cache\n\n\u003e PD\\Cache is a hybrid caching system for PHP that combines Redis and filesystem caching with automatic filesystem fallback support.\n\n![tag](https://img.shields.io/badge/tag-PHP%20Library-bb4444)\n![size](https://img.shields.io/github/size/pardnchiu/PHP-Cache/src/Cache.php)\u003cbr\u003e\n![version](https://img.shields.io/packagist/v/pardnchiu/cache)\n![download](https://img.shields.io/packagist/dm/pardnchiu/cache)\n\n## Features\n\n- Hybrid caching strategy (Redis + Filesystem)\n- Automatic fallback to filesystem when Redis is unavailable\n- Built-in HTML / Text content optimization\n- Automatic cache expiration handling\n- Cache cleanup mechanism\n- MD5 key generation for cache entries\n\n## Key Capabilities\n\n- Get/Set cache with automatic storage selection\n- HTML/Text content minification\n- Automatic cache expiration\n- Cache cleanup for expired entries\n- System resilience fallback mechanism\n\n## Dependencies\n\n- `pardnchiu/redis` - For Redis caching support (optional)\n- `/storage/caches` - Write permission on storage directory\n\n## How to Use\n\n### Installation\n\n```shell\ncomposer require pardnchiu/cache\n```\n\n```php\n// Initialize cache with Redis support\n$redis = new PD\\Redis();\n$cache = new PD\\Cache($redis);\n\n// Set cache with 1-hour expiration\n$cache-\u003eset(\"page-key\", $content, 3600);\n\n// Get cached content\n$content = $cache-\u003eget(\"page-key\");\n\n// Clean expired cache entries\n$cache-\u003eclean();\n\n// Initialize cache without Redis (filesystem only)\n$cache = new PD\\Cache();\n```\n\n## License\n\nThis source code project is licensed under the [MIT](https://github.com/pardnchiu/PHP-Cache/blob/main/LICENSE) license.\n\n## Creator\n\n\u003cimg src=\"https://avatars.githubusercontent.com/u/25631760\" align=\"left\" width=\"96\" height=\"96\" style=\"margin-right: 0.5rem;\"\u003e\n\n#### Pardn Chiu\n\n\u003ca href=\"mailto:dev@pardn.io\" target=\"_blank\"\u003e\n \u003cimg src=\"https://pardn.io/image/email.svg\" width=\"48\" height=\"48\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://linkedin.com/in/pardnchiu\" target=\"_blank\"\u003e\n \u003cimg src=\"https://pardn.io/image/linkedin.svg\" width=\"48\" height=\"48\"\u003e\n\u003c/a\u003e\n\n---\n\n©️ 2024 [Pardn Chiu](https://pardn.io)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpardnchiu%2Fphp-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpardnchiu%2Fphp-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpardnchiu%2Fphp-cache/lists"}