Flush Redis from a PHP command?
-
We have REDIS running and WP-Rocket on this site.
We use WP All Import to sync pricing and stock. At the end of the sync run WP-Rocket is cleared using a purge cache command via a small php snippet. This happens automatically after the import finishes.
Some of the prices shown on the home page seem to be cached causing incorrect prices after a data import.
Is there a way to run the flush redis cache action via a php command that I could insert at the end of my import? This would clear the object cache at the same time as the page cache preventing outdated prices showing.
Set up wp config as below with the domains and ports changed:
define(‘WP_CACHE_KEY_SALT’, ‘domainname.com’ );
define(‘WP_REDIS_PASSWORD’, ‘ourredisdbpassword’ );
define(‘WP_REDIS_HOST’, ‘127.0.0.123’);
define(‘WP_REDIS_PORT’, ‘1234’);
define(‘WP_REDIS_DATABASE’, 1 );
define(‘WP_REDIS_SELECTIVE_FLUSH’, true);
define(‘WP_REDIS_MAXTTL’, ‘1800’);The page I need help with: [log in to see the link]
- The topic ‘Flush Redis from a PHP command?’ is closed to new replies.