Automattic / batcache

A memcached HTML page cache for WordPress.
http://wordpress.org/extend/plugins/batcache/
284 stars 104 forks source link

Enable specific script filenames to be excluded from Batcache #79

Open stevegrunwell opened 7 years ago

stevegrunwell commented 7 years ago

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