magento-2-blog
magento-2-blog copied to clipboard
Add full page cache support to post listings
Description
Magento gathers all identities from blocks and adds them to the X-Magento-Tags header for the page. By adding the post cache tag to the post list identities, pages cached to the full page cache containing post lists are cleared from the full page cache when any post is saved in Magento.
Additionally fixed a bug where the post model didn't implement the identity interface. Without implementing the interface, Magento is not aware that the post model has identities.
Manual testing scenarios
- Load a post list in frontend, make sure it is loaded from full page cache.
- Create a new post in Magento admin and save it.
- Load the post list again. It should be cleared from full page cache and show the updated list with the new post.
Contribution checklist
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All new or changed code is covered with unit/integration tests (if applicable)
This PR fixes #287
Code checks failing sucks when its not really the change's issue. It is implenting a mandatory interface and then using the proper public class constant from the entity. In my opinion the rules should be reworked to better meet the code base's requirements.
hi @aapokiiso, Thanks for your contribution. We will review and update this as soon as possible.
We highly appreciate and idea like you to make our product better. Thank you very much!
@phutx Hi, thanks for the comment! It would be great if eventually the module would not use the cacheable="false"
workaround at all, and instead always just clear relevant identities when saving posts / topics / categories / tags etc :slightly_smiling_face:
I can confirm the cache issue still persists. Blog pages are not cacheable.