{"id":13624019,"url":"https://github.com/cakephp/cache","last_synced_at":"2025-06-25T23:07:22.597Z","repository":{"id":21361476,"uuid":"24678687","full_name":"cakephp/cache","owner":"cakephp","description":"[READ-ONLY] Easy to use Caching library with support for multiple caching backends. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp","archived":false,"fork":false,"pushed_at":"2025-05-17T03:07:39.000Z","size":17247,"stargazers_count":51,"open_issues_count":0,"forks_count":10,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-17T04:18:02.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cakephp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2014-10-01T13:06:49.000Z","updated_at":"2025-02-01T18:54:03.000Z","dependencies_parsed_at":"2024-01-28T04:28:55.019Z","dependency_job_id":"984cf82d-c53d-4f43-b68a-a9469677430d","html_url":"https://github.com/cakephp/cache","commit_stats":{"total_commits":432,"total_committers":62,"mean_commits":6.967741935483871,"dds":0.7685185185185185,"last_synced_commit":"c10b6073779129520a689e1b6fac2d7020ab95bc"},"previous_names":[],"tags_count":306,"template":false,"template_full_name":null,"purl":"pkg:github/cakephp/cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cakephp","download_url":"https://codeload.github.com/cakephp/cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fcache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261967132,"owners_count":23237663,"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":[],"created_at":"2024-08-01T21:01:37.875Z","updated_at":"2025-06-25T23:07:22.568Z","avatar_url":"https://github.com/cakephp.png","language":"PHP","readme":"# CakePHP Caching Library\n\nThe Cache library provides a `Cache` service locator for interfacing with multiple caching backends using\na simple to use interface.\n\nThe caching backends supported are:\n\n* Files\n* APC\n* Memcached\n* Redis\n* Wincache\n* Xcache\n\n## Usage\n\nCaching engines need to be configured with the `Cache::config()` method.\n\n```php\nuse Cake\\Cache\\Cache;\n\n// Using a short name\nCache::config('default', [\n    'className' =\u003e 'File',\n    'duration' =\u003e '+1 hours',\n    'path' =\u003e sys_get_tmp_dir(),\n    'prefix' =\u003e 'my_app_'\n]);\n\n// Using a fully namespaced name.\nCache::config('long', [\n    'className' =\u003e \\Cake\\Cache\\Engine\\ApcuEngine::class,\n    'duration' =\u003e '+1 week',\n    'prefix' =\u003e 'my_app_'\n]);\n\n// Using a constructed object.\n$object = new FileEngine($config);\nCache::config('other', $object);\n```\n\nYou can now read and write from the cache:\n\n```php\n$data = Cache::remember('my_cache_key', function () {\n\treturn Service::expensiveCall();\n});\n```\n\nThe code above will try to look for data stored in cache under the `my_cache_key`, if not found\nthe callback will be executed and the returned data will be cached for future calls.\n\n## Documentation\n\nPlease make sure you check the [official documentation](https://book.cakephp.org/4/en/core-libraries/caching.html)\n\n\n","funding_links":[],"categories":["目录","Table of Contents","PHP","缓存 Caching","缓存( Caching )"],"sub_categories":["缓存和锁定 Caching and Locking","Caching and Locking","Caching"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Fcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcakephp%2Fcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Fcache/lists"}