Lesti_Fpc is internal full page cache for Magento. This Cache needs no varnish or any other extenal software and works with events. It is an internal cache and so it replaces dynamic blocks before sending response to customer. Here is little post that explains the workflow of Lesti_Fpc.

Which pages can be cached?

Per default is cached:

  • cms_index_index
  • cms_page_index
  • catalog_product_view
  • catalog_category_view

You can add your own layout-handles in the configurations.

Which blocks are dynamic or lazy?

Per default are the following dynamic blocks:

  • global_messages
  • messages
  • right.reports.product.viewed
  • global_notices

Per default are the following lazy blocks:

  • top.links
  • cart_sidebar
  • catalog.compare.sidebar
  • wishlist_sidebar
  • welcome (Magento >= 1.8, for Magento 1.7 please read this post)

You can add your own dynamic block in the configurations (only blocks without children). Here you can find a explanation what dynamic and lazy blocks are. If you don’t know the name of your block in magento, here is a little post about it.

How to refresh lazy blocks?

The following actions refresh the lazy blocks:

  • checkout_cart_add
  • checkout_cart_delete
  • checkout_cart_updatePost
  • catalog_product_compare_add
  • catalog_product_compare_clear
  • catalog_product_compare_remove
  • wishlist_index_add
  • wishlist_index_remove
  • wishlist_index_update
  • wishlist_index_allcart
  • wishlist_index_configure

You can add your own refresh actions in the configurations. If you think I missed some default one, please contact me.

What about uri-params?

The following uri-params can be handled per default:

  • id
  • category
  • page_id
  • p
  • limit
  • dir
  • order
  • mode

There is a little post to explain uri parameters. You can add your own params in the configurations. If your layered navigation don’t work, please read this post.

Want to miss some requests?

These are the default miss uri params:

  • no_cache=1
  • limit=/[0-9]+/
  • dir=/[0-9a-z_]+/
  • order=/[0-9a-z_]+/
  • mode=/[0-9a-z_]+/
  • ___store=/[a-z]{1}[0-9a-z_]*/

If you didn’t want to cache a request you just have to add a parameter. here is a post that explains it.

The following session-params can be handled per default:

  • limit_page
  • sort_order
  • sort_direction
  • display_mode

You can add your own params in the configurations

Excluding a category or product

You can exclude for example a category with id 25, by adding CATEGORY_25 to Bypass Handles in the configs of FPC.

What about multistore, multicurrency, mobilethemes and customergroups?

Lesti_Fpc can handle multistore, multicurrency, mobilethemes and different Prices for different customergroups.

What about cache lifetime?

Per default is the lifetime of a page 24 hours. You can edit under in app/etc/fpc.xml. Pages will be flushed after save of product, category, cms-page and cms-block.

Filecache gets too big?

You can compress the cached data with gzcompress from level 0 to 9.

What about apc, memcached, redis and so on?

You can set every other cachebackend like apc, memcached or redis in app/etc/fpc.xml. In the same style you did it in app/etc/local.xml.

Where are the configurations?

You can refresh, disable or enable hole Cache under System => Cache Management. The configurations are under System => Configuration => Advanced => System => Lesti FPC.

Magento Version?

Lesti_Fpc is compatible with Magento CE 1.5, 1.6, 1.6.1,, 1.7, 1.8, 1.8.1, 1.9

Possible conflicts?

Lesti_Fpc rewrites the block core/messages.

Here is a list of people that know how to deal with Lesti_Fpc and can give paid support.

1,150 thoughts on “Lesti_Fpc”

  1. Hi Gordon,

    This is a great extension, thank you!
    I am having a few issues though, which I was hoping you could help me with.

    1. I have a basket within my header with a recently added fly out. I have added the block name to the lazy blocks within the configs but on some occasions the basket block doesn’t show or does not update. For instance, if I view a product info page the basket might not be visible but after adding the product it shows. If I then click back to the homepage the basket will be visible but doesn’t have the updated basket – it will just show as ‘My Basket 0 Items’. Do I need to make any other config changes for this to show correctly on all pages?

    2. I have configured my top level categories as anchors, when I update a product (e.g. price) within one of the anchors sub categories the product listing page updates on the categories the product is associated to but not the anchor category layout. How do I get this to update as well?

    Your help would be much appreciated.

    1. Hello,
      1. Please make sure that the block name is just in lazy or dynamic blocks. Please make sure that the block name is unique in the layout. If you use a ajax based add to cart function, I would prefer a dynamic instead of lazy block. Please make sure, that html minification is disabled.
      2. I’m not sure what a category as anchor is.

  2. I am noticing a problem where when I add to cart on a product page it takes me to empty cart. Yet if I go back and add to cart again then it works. If I turn off fpc the problem seems to go away. I’m seeing stuff about session id’s not being in first time or something on some other sites. How do I fix this but keep caching on since there is a major speed difference if I turn it off. Yet on if it goes to empty cart page I may lose customers..

  3. Hi Gordon,
    Is there any trick to making the ‘active’ top.menu items relevant for the product being viewed? Whichever product is first to be viewed following a cache clear seems to dictate the active menu items (only for products – categories are fine) from that point forward in our store. We’ve tried making top.menu / catalog.topnav a dynamic or lazy block but it seems to make no difference, the ‘active’ states are cached regardless.

  4. Hello,
    I try to exclude a cms block from cache on my product landing page by putting the block name in “Bypass Handles”. I also try putting the block name under dynamic blocks. However, the block remain caches anyway for both way. Any recommend solution? Thank you

    1. Hello Jacky,
      first, the “Bypass Handles” are for actions that should be bypassed by Fpc, for example catalog_category_56 to exclude the category with id 56 from the Fpc. What nameInLayout does your cms block has?

  5. Hi Gordon,

    We are using Google Adwords…Is there a way to ignore “gclid” query string parameters on URLs and still serve up the cached content? For example www.xxx.com/category/2?gclid=303dfwtg4t244266

    Thanks Toni

    1. Hello Toni,
      yes, in general this possible. You can use Uri Params or Miss Params to solve this, but both aren’t that good solutions, cause they will increase the misses and decrease the hits in the cache. What model/block etc. did need this parameter and how? Maybe it’s better to find a solution with dynamic blocks.

  6. Hi,

    Our website was very lazy, but after using Lesti_Fpc it worked as a rocket. I don’t know if the issue is because of the extension but from few days my website is troubled with too many request & i usually get an error of “Mysql Gone Away” & “Too Many Connections. I have adjusted the max_connection to 300, but still the issue. I thought you might be able to help.

    Thanks in anticipation, regards

  7. I like your extension, its way more powerful than the others out there, even the paid ones. I want to build a primitive crawler to work with your extension. Is there a way to hit a url a flush that cache for that page? If not, how would i go about doing something like that by a query param like ?flush_page=1 or something like that.

  8. Hi Gordon,

    We’re having trouble with our logo’s img src url not updating for secure pages and producing “Connection is not secure” warnings.

    The theme we’re using includes the logo img html using a static block like so


    header.phtml includes that child block like so

    getChildHtml(‘theme_logo’, false) ?>

    and “the_logo” static block contains

    We tried adding both “theme_logo” and “the_logo” as lazy blocks but the block is still not being refreshed.

    Do you have any advice on how to combat this? We could hard code the path to the image in the static block minus the protocol (//path/logo.jpg) and that does work but we’d prefer to have {{media url=}} update it’s protocol properly if possible.

    1. Hello,
      normally Fpc can differ between http and https witht he port of the request. Can it be that you have load balancer in front of your webserver? If yes, please update to the current version 1.4.3 and your issue should be solved.

      1. I spoke too soon it seems as I hadn’t yet turned caching on… Having just upgraded our store to and all extensions along with it we’re still getting http for the logo img src rather than https on secure pages :(

  9. Hey Gordon. First of all, thanks for this amazing and yet free extension. So nice of you.

    I was having a problem with a nameless block (ANONYMOUS_) for random products in the homepage, but reading your comments here I endup´using javascript and it now works flawless.

    But I still have one problem, I use a custom script in my header.phtml which make multi-domain login in my store (http://excellencemagentoblog.com/blog/2012/12/15/magento-multiple-website-login/) and as header is cached, this script dosen’t work anymore. I tried adding “header” to lazy blocks, but it breaks my header layout, don’t know why. Is there anyway to force my header.phtml to never be cached?

    Thank you!

  10. Ok, now I’m facing a really weird glitch. I have a Ajax Login extension which adds Register and Login forms to homepage to be called via Ajax. To make the module to work with Lesti_FPC I had to change some things in the module layout.xml, but it seems that this made Lesti_FPC go crazy.

    When I’m using Lesti _FPC is shows the register form in the footer of the page, when I turn it off, it dosen’t show it anymore. I tried uninstalling the Ajax module but the register form still on the footer of my store when Lesti_FPC is turned on. I also tried deleting “var” folder, it didn’t worked. It seems that Lesti_FPC save this block info in some magical place (maybe database?) and now is always loading it, even with flushed cache.

    Do you have any idea what might be causing this? Is there anyway to delete all data from Lesti_FPC and start again?

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *