wp-media / wp-rocket-cli

WP CLI interface for the WP Rocket plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hook on basic WP Cli commands

MaximeCulea opened this issue · comments

I thought that on wp cli cache flush, wp rocket would also clean his cache, which is not the case. Don't you think it could be useful too?

Hi @MaximeCulea Does wp cli cache flush is related to object cache?

Yeah it is: https://developer.wordpress.org/cli/commands/cache/flush/

But maybe it's wise to no reuse the same "point of entry" to clear the WP Rocket cache. I am thinking of the fact that WPR could also be related to Static Cache, CDN, etc. So doing a "WordPress flush cache" could lead to more than clearing the object cache after all.

What is the need to clear the object cache? It's mainly related to database updates, right?

I'm asking the question as I'm wondering if it's not going to flush too much the caching files for no needs.

Yes it is, but as WP is mainly a CMS and deliver the content contributed from database to be rendered, when the content is displayed, through static cache, there is also DB calls, which means object cache, isn't it?

We don't clear WP Rocket cache when the object cache is flushed on a regular instance, so I don't think we should do it when on CLI. Better to preserve a behaviour as similar as possible.