Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
207 stars 43 forks source link

fix(hpb-caching): include last-modified timestamp in the cache group #1928

Closed adekbadek closed 3 weeks ago

adekbadek commented 3 weeks ago

All Submissions:

Changes proposed in this Pull Request:

The blocks are cached for five minutes and there is no way of invalidating this cache. This change will invalidate the cache if the page containing the block has been modified.

Especially looking for @claudiulodro 's input as the original feature author.

How to test the changes in this Pull Request:

  1. On release, make sure the homepage is set to display the HPB with the latest posts
  2. Publish a new post, observe it absent from the homepage
  3. Switch to this branch, again publish a new post, observe the homepage contains the new post

Other information:

adekbadek commented 3 weeks ago

Closing in favor of #1929, but it's not conflicting. This optimization can be deployed another time.