We are using Magento Enterprise and use flat tables and automatic re-index.
I have a block that extends Mage_Catalog_Block_Product_List. Block cache is enabled and block cache is tagged with all the products it contains. When I save any of the products that are in the block in the admin, the block cache is deleted. This all works correctly.
The problem appears when I enable flat tables. When the product is changed in backend the block cache is deleted, but product flat tables are not yet updated. The new block cache is created with old data. I must be missing something, because this would not work for anyone using flat tables. And this is all Magento "core".
How should I approach solving this? I there an event being fired, that I should be observing?
Any suggestion would be greatly appreciated.
**************** EDIT ***************
Let me try to clarify:
- Product has name "My cool product"
- EAV, flat tables and block HTML cache contain "My cool product"
- Change name to "My cool product with new name"
- Block HTML cache gets deleted
- EAV contains "My cool product with new name" but flat table still contains "My cool product" (reindex has not happened)
- Customer visits the website and a new block HTML cache is generated from flat tables data which still contains "My cool product"
- EAV contains "My cool product with new name", flat tables and block HTML cache still contain "My cool product"
- Reindex runs
- EAV and flat tables contain "My cool product with new name" but block HTML cache still contains "My cool product"
Time between points 1 and 7 is less than a second.
**************** EDIT ***************
catalog_product_flat