PHP code example of idearia / wordpress-cache-busting
1. Go to this page and download the library: Download idearia/wordpress-cache-busting library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
idearia / wordpress-cache-busting example snippets
class CacheBuster extends \Idearia\WordPressCacheBusting\CacheBuster
{
protected $assets = [
/**
* Example of dynamic cache invalidation
*/
[
'handle' => 'some-script-or-css',
'path' => 'wp-content/plugins/some-plugin/script.js',
],
/**
* Example of static cache invalidation
*/
[
'handle' => 'some-other-script-or-css',
'ver' => '1.2.3',
],
];
}
new CacheBuster;