Super cache configuration export/ import
The question is how to save WP Super Cache plugin configuration while deploy a new version of the web.
We have two domains: example.com (deploy) - with caching on dev.example.com (dev version) - with WPSC plugin turned off
While new deploy we use the bash script so the full process gets ~2 minutes
Problem is that after deployment we have to restore WPSC settings manually and its a bit terrible. We can not use saved wp-cache-config.php file because $cache_page_secret constant is unique.
Is there any way to save and restore the configuration?
Wp-cli has no option to do it for now. Could be:
wp super-cache export-settings >file
wp super-cache import-settings <file
So during deploy could be the sequence:
wp plugin activate wp-super-cache wp super-cache enable wp super-cache flush wp super-cache import-settings <file
It would be really great!
Reviewed the code involved, the secret in this case is simply this just this: md5( date( 'H:i:s' ) . mt_rand() );
You could execute that code & dump your own secret to the file. Should prove straightforward, thanks! Something like this: cache_page_secret=$(php -r 'echo md5( date( "H:i:s" ) . mt_rand() );')