{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/66931158","id":66931158,"diff_hunk":"@@ -0,0 +1,73 @@\n+.. index::\n+   single: Cache\n+   single: Performance\n+   single: Components; Cache\n+\n+The Cache Component\n+===================\n+\n+    The Cache component provides a strict `PSR-6`_ implementation for adding\n+    cache to your applications. It is designed to have a low overhead and it\n+    ships with ready to use adapters for the most common caching backends.\n+\n+Installation\n+------------\n+\n+You can install the component in 2 different ways:\n+\n+* :doc:`Install it via Composer </components/using_components>` (``symfony/cache`` on `Packagist`_);\n+* Use the official Git repository (https://github.com/symfony/cache).\n+\n+.. note::\n+\n+    In Symfony applications this component is integrated (and enabled by\n+    default) through the FrameworkBundle.\n+\n+Key Concepts\n+------------\n+\n+Before starting to use the Cache component, it's important that you learn the\n+meaning of some key concepts:\n+\n+* **Item**, a single unit of information stored as a key/value pair, where the\n+  key is the unique identifier of the information and the value is its contents;\n+* **Pool**, a logical repository of cache items. All cache operations (saving\n+  items, looking for items, etc.) are performed through the pool. Applications\n+  can define as many pools as needed.\n+* **Adapter**, it implements the actual caching mechanism to store the\n+  information in the filesystem, in a database, etc. The component provides\n+  several ready to use adapters for common caching backends (Redis, APCu, etc.)\n+\n+Basic Usage\n+-----------\n+\n+This component is a strict implementation of `PSR-6`_, which means that the API\n+is the same as defined in the standard. Before starting to cache information,\n+create the cache pool using any of the built-in adapters. For example, to create\n+a filesystem-based cache, instantiate :class:`Symfony\\\\Component\\\\Cache\\\\Adapter\\\\FilesystemAdapter`::\n+\n+    use Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter;\n+\n+    $cache = new FilesystemAdapter();\n+\n+Now you can create, retrieve, updated and delete items using this cache pool::\n+\n+    // create a new item by trying to get it from the cache\n+    $numProducts = $cache->getItem('stats.num_products');\n+\n+    // assign a value to the item and save it\n+    $numProducts->set(4711);\n+    $cache->save($numProducts);\n+\n+    // retrieve the cache item\n+    $numProducts = $cache->getItem('stats.num_products');\n+    // check whether the item exists in the cache\n+    $isCached = $numProducts->isHit();","path":"components/cache/introduction.rst","position":65,"original_position":65,"commit_id":"f2234ed77d192c04aeebba0f66611406a15f4f82","original_commit_id":"f2234ed77d192c04aeebba0f66611406a15f4f82","user":{"login":"WouterJ","id":749025,"avatar_url":"https://avatars.githubusercontent.com/u/749025?v=3","gravatar_id":"","url":"https://api.github.com/users/WouterJ","html_url":"https://github.com/WouterJ","followers_url":"https://api.github.com/users/WouterJ/followers","following_url":"https://api.github.com/users/WouterJ/following{/other_user}","gists_url":"https://api.github.com/users/WouterJ/gists{/gist_id}","starred_url":"https://api.github.com/users/WouterJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WouterJ/subscriptions","organizations_url":"https://api.github.com/users/WouterJ/orgs","repos_url":"https://api.github.com/users/WouterJ/repos","events_url":"https://api.github.com/users/WouterJ/events{/privacy}","received_events_url":"https://api.github.com/users/WouterJ/received_events","type":"User","site_admin":false},"body":"we don't check anything here, we just simply store a boolean. What about:\r\n```php\r\n// retrieve the cache item\r\n$numProducts = $cache->getItem('stats.num_products');\r\nif (!$numProducts->isHit()) {\r\n    // ... item does not exists in the cache\r\n}\r\n// retrieve the value stored by the item\r\n$total = $numProducts->get();\r\n```","created_at":"2016-06-14T08:49:52Z","updated_at":"2016-06-14T08:49:52Z","html_url":"https://github.com/symfony/symfony-docs/pull/6515#discussion_r66931158","pull_request_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6515","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/66931158"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/6515#discussion_r66931158"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6515"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6515","id":67705038,"html_url":"https://github.com/symfony/symfony-docs/pull/6515","diff_url":"https://github.com/symfony/symfony-docs/pull/6515.diff","patch_url":"https://github.com/symfony/symfony-docs/pull/6515.patch","issue_url":"https://api.github.com/repos/symfony/symfony-docs/issues/6515","number":6515,"state":"open","locked":false,"title":"Added the documentation for the Cache component","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"body":"This fixes #6171.\r\n\r\nThis is WIP because there's more documentation to come ... but you can already review the proposed documentation. Thanks!","created_at":"2016-04-25T11:37:15Z","updated_at":"2016-06-14T08:49:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b34445ef5657183f98189f5ab4491d090d185c7a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6515/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6515/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/issues/6515/comments","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/f2234ed77d192c04aeebba0f66611406a15f4f82","head":{"label":"javiereguiluz:cache_component","ref":"cache_component","sha":"f2234ed77d192c04aeebba0f66611406a15f4f82","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"repo":{"id":26866700,"name":"symfony-docs","full_name":"javiereguiluz/symfony-docs","owner":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/javiereguiluz/symfony-docs","description":"The Symfony2 documentation","fork":true,"url":"https://api.github.com/repos/javiereguiluz/symfony-docs","forks_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/forks","keys_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/teams","hooks_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/events","assignees_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/tags","blobs_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/subscription","commits_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/merges","archive_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/downloads","issues_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/releases{/id}","deployments_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/deployments","created_at":"2014-11-19T15:08:31Z","updated_at":"2016-04-05T15:03:48Z","pushed_at":"2016-05-29T19:03:48Z","git_url":"git://github.com/javiereguiluz/symfony-docs.git","ssh_url":"git@github.com:javiereguiluz/symfony-docs.git","clone_url":"https://github.com/javiereguiluz/symfony-docs.git","svn_url":"https://github.com/javiereguiluz/symfony-docs","homepage":"http://symfony.com/doc/current/","size":35426,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"90b1a093cf806ce012f8663744d0ee2f28cc3b11","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":521583,"name":"symfony-docs","full_name":"symfony/symfony-docs","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony-docs","description":"The Symfony documentation","fork":false,"url":"https://api.github.com/repos/symfony/symfony-docs","forks_url":"https://api.github.com/repos/symfony/symfony-docs/forks","keys_url":"https://api.github.com/repos/symfony/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony-docs/teams","hooks_url":"https://api.github.com/repos/symfony/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony-docs/events","assignees_url":"https://api.github.com/repos/symfony/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony-docs/tags","blobs_url":"https://api.github.com/repos/symfony/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony-docs/subscription","commits_url":"https://api.github.com/repos/symfony/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony-docs/merges","archive_url":"https://api.github.com/repos/symfony/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony-docs/downloads","issues_url":"https://api.github.com/repos/symfony/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony-docs/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony-docs/deployments","created_at":"2010-02-17T08:43:51Z","updated_at":"2016-06-13T21:49:04Z","pushed_at":"2016-06-13T20:50:48Z","git_url":"git://github.com/symfony/symfony-docs.git","ssh_url":"git@github.com:symfony/symfony-docs.git","clone_url":"https://github.com/symfony/symfony-docs.git","svn_url":"https://github.com/symfony/symfony-docs","homepage":"http://symfony.com/doc","size":55692,"stargazers_count":1118,"watchers_count":1118,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2475,"mirror_url":null,"open_issues_count":300,"forks":2475,"open_issues":300,"watchers":1118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6515"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/6515"},"issue":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/6515"},"comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/6515/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6515/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6515/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony-docs/statuses/f2234ed77d192c04aeebba0f66611406a15f4f82"}}}}
{"actor":{"display_login":"WouterJ"}}