wp-media / wp-rocket-cli

WP CLI interface for the WP Rocket plugin
74 stars 37 forks source link

Hook on basic WP Cli commands #33

Closed MaximeCulea closed 3 years ago

MaximeCulea commented 4 years ago

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?

GeekPress commented 3 years ago

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

MaximeCulea commented 3 years ago

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.

GeekPress commented 3 years ago

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.

MaximeCulea commented 3 years ago

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?

remyperona commented 3 years ago

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.