Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flushing of all CMS pages and blocks when products or categorie… #235

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added flushing of all CMS pages and blocks when products or categorie… #235

wants to merge 2 commits into from

Conversation

talisman-innovations
Copy link

…s are saved.

We are successfully using Lesti_FPC on a number of projects. However some of our customers have widgets or locally injected blocks in CMS pages, that depend on products or categories. For example a widget that shows all the new products in a category on the homepage. These blocks don't get updated until the page is refreshed 1 day later.

Currently the FPC only cleans the CMS pages/blocks when they are changed. This patch also cleans all the CMS pages and blocks if changes are made to the categories or the products. It seems to work well on our installation. There seems to be no performance impact, but I guess if you make constant product/category changes then there would be more cleaning of the CMS pages and blocks.

I hope this helps as I saw a couple of issues posted with similar looking issues to this.

Steve

@GordonLesti
Copy link
Owner

Hello @talisman-innovations
thank you for the PR. Unfortunately this would always clean all CMS pages and blocks when a product would be cleaned. A better way is to add the tag of product to the CMS page. For example here Lesti_Fpc_Helper_Block::getCacheTags is collecting the product tags of product_list block.

@talisman-innovations
Copy link
Author

Hi Gordon

Yes i see the (small) impact of flushing the CMS pages and blocks and thought there may be a better way. How would I go about adding a tag for a product or category to a CMS page? Is there a way to do that via the CMS editor in admin for example - that would be ideal.

Just to make my problem clear. I have a home page with the following content -

{{widget type="newproducts/product_widget_new" products_count="4" column_count="4" title_text="Hot Deals" title_link="/hot-deals.html" category_id="category/74" show_productname="yes" show_productreview="yes" show_productprice="yes" show_addtolinks="no" image_width="268" image_height="268" template="activo/newproducts/widget/new_grid.phtml"}}

The widget gets a list of products from a category. The shop makes quite constant changes to the products and also which category the products are in - for example they have a promoted category that they update frequently.

So if I could let Lesti_FPC know that this page depends on products and on categories, then it could be cleaned when products or categories are updated, but the other blocks and pages could be left alone. Perfect solution!

Is there a way to do that currently in Lest_FPC.

Steve

On 7 Jun 2016, at 11:28, Gordon Lesti notifications@github.com wrote:

collecting the product tags of product_list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants