What are lazy and dynamic Blocks in Lesti_Fpc?

In Lesti_Fpc 1.1.0 I created a new type of dynamic blocks. I call them lazy blocks. First I will explain what dynamic blocks are and what the difference to lazy blocks is.

What are dynamic blocks?

Other full page caches call this holepunching. I call this dynamic blocks, cause my first contact with a fpc was Stephan Hoyers fork of Fabrizio Brancas Aoe_Static. And in this fork it was called dynamic customer blocks. Dynamic blocks are these parts of a cached page, that have special customer data. For example the block cart_sidebar. These blocks will be rendered on every request.

Dynamic blocks

The red rectangles in this image, are default dynmic blocks. There are also others like messages, global_messages, global_notices and so on. I said, these blocks will be rendered on every request of a customer. But in the most cases, these blocks are also static for every customer. Only in a few cases like adding a product to cart or wishlist, the dynamic blocks of a customer should rendered again. So I build the tag lazy for a block.

What are lazy blocks?

Lazy blocks will be chached in the customer session. And they will be flushed after special actions. Normally every dynamic block can be lazy block. For example the block cart_sidebar. This block can be cached static in the session. But he should be flushed after every hit of the actions checkout_cart_delete, checkout_cart_updatePost, catalog_product_compare_add. Only blocks like global_messages, global_notices, messages and right.reports.product.viewed should be real dynamic blocks and should be rendered every request.

How to configurate lazy blocks?

I hate complicated configurations in magento. For such a complex thing like a fpc, I guess the configurations are quite simple. But I added two new fields: refresh_actions and lazy_blocks. In the field lazy blocks you can add all blocks that should be different between two users, but static for every single user. And after hitting one of the refresh actions, these lazy blocks will be refreshed. The blocks will be refreshed also after changing currency, customergroup, desing, store, port or host.

Summary of lazy blocks

If you didn't like the lazy blocks or you have blocks with random content. You can put these blocks into the dynamic blocks and everything is fine. Normally every lazy block can be an dynamic block. But please note that every dynamic block increases the time for the response.

Next Previous