{"action":"closed","issue":{"url":"https://api.github.com/repos/Automattic/batcache/issues/24","labels_url":"https://api.github.com/repos/Automattic/batcache/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/batcache/issues/24/comments","events_url":"https://api.github.com/repos/Automattic/batcache/issues/24/events","html_url":"https://github.com/Automattic/batcache/issues/24","id":22808680,"number":24,"title":"Provide an example on how to override default configuration","user":{"login":"andrezrv","id":4804515,"avatar_url":"https://avatars.githubusercontent.com/u/4804515?v=3","gravatar_id":"","url":"https://api.github.com/users/andrezrv","html_url":"https://github.com/andrezrv","followers_url":"https://api.github.com/users/andrezrv/followers","following_url":"https://api.github.com/users/andrezrv/following{/other_user}","gists_url":"https://api.github.com/users/andrezrv/gists{/gist_id}","starred_url":"https://api.github.com/users/andrezrv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrezrv/subscriptions","organizations_url":"https://api.github.com/users/andrezrv/orgs","repos_url":"https://api.github.com/users/andrezrv/repos","events_url":"https://api.github.com/users/andrezrv/events{/privacy}","received_events_url":"https://api.github.com/users/andrezrv/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2013-11-17T23:56:38Z","updated_at":"2015-10-21T13:06:52Z","closed_at":"2015-10-21T13:06:52Z","body":"I think an example on how to use a custom configuration would be really helpful for people who don't like reading the code to know how to do that.\r\n\r\nI'm doing this by having a file named `batcache-config.php`, which is included in `wp-config.php` this way:\r\n\r\n```PHP\r\nif ( file_exists( dirname( __FILE__ ) . '/batcache-config.php' ) ) {\r\n\tinclude( dirname( __FILE__ ) . '/batcache-config.php' );\r\n}\r\n```\r\n\r\nAnd this is the content of my `batcache-config.php`:\r\n\r\n```PHP\r\n<?php\r\n\r\n// =================\r\n// Batcache settings\r\n// =================\r\n\r\nglobal $batcache;\r\n\r\n$batcache = array(\r\n\t'max_age'           => 300,\r\n\t'remote'            => 0,\r\n\t'times'             => 1,\r\n\t'seconds'           => 0,\r\n\t'group'             => 'batcache',\r\n\t'unique'            => array(),\r\n\t'headers'           => array(),\r\n\t'cache_redirects'   => false,\r\n\t'redirect_status'   => false,\r\n\t'redirect_location' => false,\r\n\t'uncached_headers'  => array( 'transfer-encoding' ),\r\n\t'debug'             => true,\r\n\t'cache_control'     => true,\r\n\t'cancel'            => false,\r\n);\r\n```\r\n\r\nMaybe someone could come up with a cleaner way to do this.\r\n\r\nI think this is a great plugin, and I hope this helps."}}