Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an extensibility mechanism for caching plugins #104

Open
ndiego opened this issue Jun 26, 2024 · 1 comment
Open

Add an extensibility mechanism for caching plugins #104

ndiego opened this issue Jun 26, 2024 · 1 comment
Labels
Enhancement New enhancement or feature request.

Comments

@ndiego
Copy link
Owner

ndiego commented Jun 26, 2024

Block Visibility currently does not have a mechanism for clearing a page's cache when a block needs to become visible, such as with the Date & Time control. The general advice is to disable caching on pages that require dynamic content. Is there an extensibility mechanism that could be added to the plugin that would make it much easier for developers to use third-party caching plugins alongside Block Visibility?

Feedback from WP Rocket:

For the cache to be cleared automatically, the block would need to trigger an update of the post itself. So to make this work, maybe you could check with the plugin developer to see if there is any action that is fired when the block is supposed to become visible. Then you could write a small function that hooks into it to clear the cache for that post, using rocket_clean_post().

@ndiego ndiego added the Enhancement New enhancement or feature request. label Jun 26, 2024
@MadtownLems
Copy link

Came here looking for guidance on breaking cache stuff. The idea of updating the post when a schedule changes is a cool approach that would cover a lot of those date/time ones, but wouldn't necessary help some of the other conditionals.

I'd also love to see a helper function such as "post_uses_block_visibility()" so that people could use to check if a post uses block visibility, and if so, disable page caching for it completely (similar to what we do for pages with Gravity Forms on them)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New enhancement or feature request.
Projects
None yet
Development

No branches or pull requests

2 participants