keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

update cache clearing for post actions #142

Closed coreykn closed 4 years ago

coreykn commented 4 years ago

Update settings to clear the page and/or associated cache by default if any post type has been published, updated, or trashed. When published the associated cache will be cleared. When updated or trashed the page and associated cache will be cleared. This updates what was added in PR #129, removing the new clearing setting that was added in favor of the setting updated in this PR:

This has been changed because when any post type (e.g. page, post, product, etc.) has been created or updated the associated cache should be cleared by default in most, if not all cases. The associated cache currently consists of the archives pages (including the pagination) but will eventually include search pages and anything else that may be required. This will ensure all pages that either currently or will contain the created/updated post are cleared. If no pages exist that meet the associated cache criteria then nothing will be cleared.

This keeps our shared philosophy with WordPress to make decisions, not options, or in other words do not provide an unnecessary choice for our users to make if all in this case will likely want it enabled. This will make it so we start with fewer configuration choices and keep Cache Enabler to fit most use cases out of the box. We can gather the feedback of users and if more post action control needs to be introduced at a later point it can be added.