batcache icon indicating copy to clipboard operation
batcache copied to clipboard

Enable specific script filenames to be excluded from Batcache

Open stevegrunwell opened this issue 8 years ago • 0 comments

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' ),
);

stevegrunwell avatar Dec 14 '16 15:12 stevegrunwell