{"action":"closed","issue":{"url":"https://api.github.com/repos/k-next/kirby/issues/457","repository_url":"https://api.github.com/repos/k-next/kirby","labels_url":"https://api.github.com/repos/k-next/kirby/issues/457/labels{/name}","comments_url":"https://api.github.com/repos/k-next/kirby/issues/457/comments","events_url":"https://api.github.com/repos/k-next/kirby/issues/457/events","html_url":"https://github.com/k-next/kirby/issues/457","id":322203651,"node_id":"MDU6SXNzdWUzMjIyMDM2NTE=","number":457,"title":"[Cms] Don't load the whole Kirby when cache is true","user":{"login":"jenstornell","id":927011,"node_id":"MDQ6VXNlcjkyNzAxMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/927011?v=4","gravatar_id":"","url":"https://api.github.com/users/jenstornell","html_url":"https://github.com/jenstornell","followers_url":"https://api.github.com/users/jenstornell/followers","following_url":"https://api.github.com/users/jenstornell/following{/other_user}","gists_url":"https://api.github.com/users/jenstornell/gists{/gist_id}","starred_url":"https://api.github.com/users/jenstornell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenstornell/subscriptions","organizations_url":"https://api.github.com/users/jenstornell/orgs","repos_url":"https://api.github.com/users/jenstornell/repos","events_url":"https://api.github.com/users/jenstornell/events{/privacy}","received_events_url":"https://api.github.com/users/jenstornell/received_events","type":"User","site_admin":false},"labels":[{"id":848081548,"node_id":"MDU6TGFiZWw4NDgwODE1NDg=","url":"https://api.github.com/repos/k-next/kirby/labels/type:%20idea%20%F0%9F%92%A1","name":"type: idea 💡","color":"1e53bd","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-11T07:56:34Z","updated_at":"2018-10-25T11:14:19Z","closed_at":"2018-10-25T11:14:18Z","author_association":"NONE","body":"*I'm only talking about the file cache in this issue*\r\n\r\nIn Kirby 2 we can do this in `config.php`:\r\n\r\n```php\r\nc::set('cache', true);\r\n```\r\n\r\nWhile it works to cache the template/snippet output, it still needs to load the whole Kirby, on every pageload.\r\n\r\n```php\r\nglobal $kirby;\r\nprint_r($kirby);\r\n\r\nc::set('cache', true);\r\n```\r\n\r\nI think there should be a better way to solve it.\r\n\r\n## Cache file in root\r\n\r\nInstead of using `config.php` which require the whole Kirby system to run, maybe look for a file in the site root. It could for example be called `CACHE`.\r\n\r\nAdditionally it can contain information about the cache, for example `type: file`.\r\n\r\n## On cache fail\r\n\r\nIf the cache file does not exists, or the cached html file does not exists, run the Kirby system like normally.\r\n\r\n## In conclusion\r\n\r\nThe faster cache, the better. To skip the loading of the whole Kirby system on each page load, I think there is time to save.\r\n\r\nMaybe it seems silly to only save a few milliseconds but in this fast web, it can make a big difference.\r\n\r\nhttps://www.fastcompany.com/1825005/how-one-second-could-cost-amazon-16-billion-sales"}}
{"actor":{"display_login":"bastianallgeier"}}