{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/discuss/issues/122","labels_url":"https://api.github.com/repos/hapijs/discuss/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/discuss/issues/122/comments","events_url":"https://api.github.com/repos/hapijs/discuss/issues/122/events","html_url":"https://github.com/hapijs/discuss/issues/122","id":92929332,"number":122,"title":"How to use cache before starting the server","user":{"login":"fobos","id":372529,"avatar_url":"https://avatars.githubusercontent.com/u/372529?v=3","gravatar_id":"","url":"https://api.github.com/users/fobos","html_url":"https://github.com/fobos","followers_url":"https://api.github.com/users/fobos/followers","following_url":"https://api.github.com/users/fobos/following{/other_user}","gists_url":"https://api.github.com/users/fobos/gists{/gist_id}","starred_url":"https://api.github.com/users/fobos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fobos/subscriptions","organizations_url":"https://api.github.com/users/fobos/orgs","repos_url":"https://api.github.com/users/fobos/repos","events_url":"https://api.github.com/users/fobos/events{/privacy}","received_events_url":"https://api.github.com/users/fobos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-03T20:00:39Z","updated_at":"2015-07-06T06:07:43Z","closed_at":null,"body":"Hi guys,\r\n\r\nI want to use a memory cache and want to start my server just after warm up the cache.\r\nSo, as I see in [documentation](http://hapijs.com/api#servercacheoptions) I can create server then configure connection and then use default memory cache.\r\n\r\nCopied form docs:\r\n\r\n```js\r\nvar server = new Hapi.Server();\r\nserver.connection({ port: 80 });\r\n\r\nvar cache = server.cache({ segment: 'countries', expiresIn: 60 * 60 * 1000 });\r\ncache.set('norway', { capital: 'oslo' }, null, function (err) {\r\n\r\n    cache.get('norway', function (err, value, cached, log) {\r\n\r\n        // value === { capital: 'oslo' };\r\n    });\r\n});\r\n```\r\n\r\nI tried the example and it doesn't work. As I understand from source code any configured cache starts only after call `server.start()` method.\r\n\r\nCould you help me to find right way to solve my task: use hapi server cache, warm it up and then start the server.\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/hapijs/discuss/issues/comments/118736167","html_url":"https://github.com/hapijs/discuss/issues/122#issuecomment-118736167","issue_url":"https://api.github.com/repos/hapijs/discuss/issues/122","id":118736167,"user":{"login":"fobos","id":372529,"avatar_url":"https://avatars.githubusercontent.com/u/372529?v=3","gravatar_id":"","url":"https://api.github.com/users/fobos","html_url":"https://github.com/fobos","followers_url":"https://api.github.com/users/fobos/followers","following_url":"https://api.github.com/users/fobos/following{/other_user}","gists_url":"https://api.github.com/users/fobos/gists{/gist_id}","starred_url":"https://api.github.com/users/fobos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fobos/subscriptions","organizations_url":"https://api.github.com/users/fobos/orgs","repos_url":"https://api.github.com/users/fobos/repos","events_url":"https://api.github.com/users/fobos/events{/privacy}","received_events_url":"https://api.github.com/users/fobos/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T06:07:43Z","updated_at":"2015-07-06T06:07:43Z","body":"@hueniverse Thanks for the response. It would be great to see improvements in next versions of hapi.\r\n\r\nRight now I have solved my task by using separate instance of Catbox and CatboxMemory."}}