Hi,
thanks for your post, and sorry for the trouble.
At this time, TablePress does indeed only clear the cache of a few caching plugins whenever a table is updated. WP Rocket is not yet among those – I’ll first have to research if they offer a programmatic way to do this – which is on my To Do list.
Thus, at this time, you’ll have to manually flush the WP Rocket cache, if you are running into caching issues. TablePress will of course still work fine.
Regards,
Tobias
Hi Tobias,
Many thanks for your response!
WP Rocket seems to have a way programmatically to clear the cache – https://docs.wp-rocket.me/article/494-how-to-clear-cache-via-cron-job
I was wondering whether I could edit the Tablepress code myself manually to call the function listed on that page? If so, would it be possible to direct me to the correct location?
The code is listed here:
<?php
// Load WordPress.
require( 'wp-load.php' );
// Clear cache.
if ( function_exists( 'rocket_clean_domain' ) ) {
rocket_clean_domain();
}
// Clear minified CSS and JavaScript files.
if ( function_exists( 'rocket_clean_minify' ) ) {
rocket_clean_minify();
}
Thank you again and understand if it is too much to ask!
Hi,
thanks for sharing this! Yes, that should be the necessary code. You could indeed add that to your TablePress copy. In particular, you’ll want to extend the _flush_caching_plugins_caches function in the /models/model-table.php file, see https://github.com/TobiasBg/TablePress/blob/a49bed720b50bbfe667afa054a8cf205ae18d2cc/models/model-table.php#L725-L755 , with only this:
// WP Rocket.
if ( function_exists( 'rocket_clean_domain' ) ) {
rocket_clean_domain();
}
The second part of the code is for flushing the CSS cache, and that could go into https://github.com/TobiasBg/TablePress/blob/a49bed720b50bbfe667afa054a8cf205ae18d2cc/classes/class-css.php#L430-L444
Regards,
Tobias
Hi Tobias,
Thank you so much – that code worked perfectly. Appreciate your assistance.
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
Hi,
thanks, I really appreciate it!
Best wishes,
Tobias