dev-master
9999999-devPHP Class to clear Google AMP Cache
CC0-1.0
The Requires
- php >=7.1
- guzzlehttp/guzzle ^6.3
The Development Requires
by Joyce Babu
cache google amp
PHP Class to clear Google AMP Cache
A simple PHP Class to update Google AMP Cache, (*1)
composer require ennexa/amp-update-cache:dev-master
To purge the cache for https://www.prokerala.com/health/?amp=1, (*2)
$var = new Ennexa\AmpCache\Update(PATH_TO_YOUR_PRIVATE_KEY); // Make sure your private key is outside document root $status = $var->purge('https://www.prokerala.com/health/?amp=1');
The script will purge the cache url from all the caches listed in AMP Project's official caches list., (*3)
If you want to purge only Google's AMP cache, you can filter the list as below, (*4)
$updater = new Ennexa\AmpCache\Update(PATH_TO_YOUR_PRIVATE_KEY); $updater->setCache(array_filter($updater->getCache(), function($cache) { return 'google' === $cache->id; })); $status = $updater->purge('https://www.prokerala.com/health/?amp=1');
PHP Class to clear Google AMP Cache
CC0-1.0
cache google amp