Created
August 6, 2019 16:46
-
-
Save Garconis/dd1137a6a9b185603d8a515e230d98bf to your computer and use it in GitHub Desktop.
Pressable | Add custom batcache settings to end of wp-config.php file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$n = ' | |
/** Custom Batcache settings for the end of wp-config.php **/ | |
global $batcache; | |
if ($batcache && WP_CACHE) { | |
$batcache->max_age = 86400; // Seconds the cached render of a page will be stored | |
$batcache->seconds = 3600; // The amount of time at least 2 people are required to visit your page for a cached render to be stored. | |
} | |
'; | |
file_put_contents(str_replace( 'wp-content', '', WP_CONTENT_DIR).'wp-config.php',$n,FILE_APPEND); | |
// add this to ensure the file only runs once (before deleting itself): | |
// unlink(__FILE__); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment