The new helper allows to disable either cache or both cache and optimizations, depending on what is needed and for whatever pages or conditions needed.
By default, it acts just like the no-cache helper - it disables cache and leaves optimizations in place for all pages, since this is the most common use.
If you set the disable_cache_for_all option to false, then the configs that follow that are applied to disable either just cache or cache and optimizations based on whether items are added to the disable_cache_and_opts or disable_cache_only options.
There is an option (disable_only_if_logged_in), which allows the cache exclusions to only be applied for logged-in users.
Description
This is a replacement for the helpers to disable page cache and should also be able to replace all similar helpers we currently have on the repo: https://github.com/wp-media/wp-rocket-helpers/blob/master/cache/wp-rocket-no-cache/ https://github.com/wp-media/wp-rocket-helpers/tree/master/cache/wp-rocket-no-cache-logged-in/ https://github.com/wp-media/wp-rocket-helpers/blob/master/cache/wp-rocket-no-cache-slugs/ https://github.com/wp-media/wp-rocket-helpers/blob/master/cache/wp-rocket-no-cache-for-page/ https://github.com/wp-media/wp-rocket-helpers/blob/master/cache/wp-rocket-no-cache-urls-regexes/ https://github.com/wp-media/wp-rocket-helpers/tree/master/cache/wp-rocket-no-cache-for-category/ https://github.com/wp-media/wp-rocket-helpers/blob/master/cache/wp-rocket-no-cache-shortcodes/ https://github.com/wp-media/wp-rocket-helpers/blob/master/cache/wp-rocket-no-cache-for-admins/ https://github.com/wp-media/wp-rocket-helpers/blob/master/cache/wp-rocket-no-cache-for-attachments/
false
, then the configs that follow that are applied to disable either just cache or cache and optimizations based on whether items are added to thedisable_cache_and_opts
ordisable_cache_only
options.disable_only_if_logged_in
), which allows the cache exclusions to only be applied for logged-in users.