batcache
batcache copied to clipboard
Enable specific script filenames to be excluded from Batcache
This PR adds a new property to the Batcache object, $uncached_files
, which is an array of script filenames. Later, when Batcache is returning early for specific filenames (under the "Never batcache interactive scripts or API endpoints." comment), this optional array of filenames is merged in.
In practice, this would allow pages like wp-login.php
or any custom, interactive endpoint be excluded from Batcache via wp-config.php
, foregoing the need to modify the advanced-cache.php
file directly.
Example usage
# wp-config.php
global $batcache;
$batcache = array(
'uncached_files' => array( 'wp-login.php', 'my-custom-script.php' ),
);