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

fix(block-caching): only serve from cache if all blocks are cached #1899

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

adekbadek
Copy link
Member

@adekbadek adekbadek commented Oct 9, 2024

All Submissions:

Changes proposed in this Pull Request:

If only some blocks are cached, rendered blocks may be duplicated. This change ensures that the cached blocks are served only if all applicable blocks on a page can be cached.

How to test the changes in this Pull Request:

  1. On release,
  2. Throw the wrench in the works by returning rand( 0, 1 ) from should_cache_block method
  3. Load a page with Homepage Posts blocks, observe that some are duplicated (might have to reload, depending on your luck)
  4. Switch to this branch, reload, observe the blocks are never duplicated

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Contributor

@claudiulodro claudiulodro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest revision works great in my testing and code looks solid. Thanks for digging into this!

@adekbadek adekbadek merged commit fb64d0c into release Oct 11, 2024
8 checks passed
@adekbadek adekbadek deleted the fix/block-caching branch October 11, 2024 07:16
matticbot pushed a commit that referenced this pull request Oct 11, 2024
## [4.2.2](v4.2.1...v4.2.2) (2024-10-11)

### Bug Fixes

* **block-caching:** only serve from cache if all blocks are cached ([#1899](#1899)) ([fb64d0c](fb64d0c))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants