magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.53k stars 9.31k forks source link

Magento FPC get flushed completely when changing category or adding a new product. #21385

Closed TimQSO closed 5 years ago

TimQSO commented 5 years ago

*Preconditions ()**

  1. Magento 2.2.7
  2. Redis Cache Enabled
  3. Built-In FPC Enabled

*Steps to reproduce ()**

  1. Warm all pages into the cache, for example with a cache warmer
  2. Check if pages are warmed on the frontend
  3. Optionally check how many Redis keys you have in Database 1 (In my case it will be 23.000+)
  4. Add a new product and add the product to a category too
  5. Save the product

*Expected result ()**

  1. Check check another, existing product on the frontend, it should still be cached
  2. Check one of the other category pages (one you didn't use to assign to your newly added product) on the frontend, it should still be cached
  3. Optionally, check the amount of Redis keys in Database 1, you would expect about the same amount of keys before adding your new product. (In my case it would be about 23.000)

*Actual result ()**

  1. Check check another, existing product on the frontend, this one isn't cached anymore
  2. Check one of the other category pages (one you didn't use to assign to your newly added product) on the frontend, this isn't cached anymore
  3. Optionally, check the amount of Redis keys in Database 1, you will see that you have far less keys than before the product save. (In my case it will be about 5.000)

Note. The page cache is being flushed to aggressive. Pages that haven't been changed are removed from the cache while this is unneeded. It causes that a site alsmost doesn't server pages from FPC and when you use a cache warmer, this warmer isn't able to keep up on busy e-commerce sites.

When flushing like this, almost every Magento 2 store has an almost empty FPC, which is a bit akward.

magento-engcom-team commented 5 years ago

Hi @GuiltyNL. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@GuiltyNL do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

magento-engcom-team commented 5 years ago

Hi @engcom-backlog-nazar. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

TimQSO commented 5 years ago

@magento-engcom-team Yes, this has been reproduced on a vanilla Magento instance.

ghost commented 5 years ago

Hi @GuiltyNL thank you for you report, i;m not able to reproduce following steps you described on clean 2.3-develop instance. deepin-screen-recorder_select area_20190222113837

TimQSO commented 5 years ago

https://github.com/magento/magento2/issues/13996

https://github.com/magento/magento2/issues/4422

I'm not alone. :)

hostep commented 5 years ago

@GuiltyNL: How are your indexers setup, as Updated by Schedule or Update on Save?

I remember a talk from @johnhughes1984 at MM19NL saying there is a bug in Magento when the latter is chosen in that it always flushes the entire cache instead of only flushing the cache specific to a certain product/category.

TimQSO commented 5 years ago

Hi @hostep indexers are updated by schedule.

Also the FPC always changes to 'INVALIDATED' after a (short) while.

The cache is also completely flushed after a customer places an order. And sometimes that is every few minutes. So our shop is uncached most of the time.

Our cache warmer tries to keep up and warms about 1.200.000 pages per day because of the constant flushing.

vnsinfo commented 4 years ago

Hi GuiltyNL Did you find a solution to this ?

thanks

TimQSO commented 4 years ago

Yes, our developers wrote a fix, it has something to do with the anchors in the 'Top Menu' because of that everything was chained together and everything was flushed.

vnsinfo commented 4 years ago

Hi There

Thanks for getting back. It would be a great help if you could point me to your developers as we have a similar problem and we are at a total loss about this.

Your help is much appreciated.

Kind Regards Hemant

From: GuiltyNL notifications@github.com Sent: Friday, 10 July 2020 1:25 AM To: magento/magento2 magento2@noreply.github.com Cc: vnsinfo hemant@vnsinfo.com.au; Comment comment@noreply.github.com Subject: Re: [magento/magento2] Magento FPC get flushed completely when changing category or adding a new product. (#21385)

Yes, our developers wrote a fix, it has something to do with the anchors in the 'Top Menu' because of that everything was chained together and everything was flushed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/21385#issuecomment-656193213 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AG66BJ3R545JAI7IUZ45BALR2XOM3ANCNFSM4GY6PDCA . https://github.com/notifications/beacon/AG66BJ2VBPJ4N3U77DY7OSTR2XOM3A5CNFSM4GY6PDCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE4OLNPI.gif

luitelbj commented 3 years ago

hi @GuiltyNL,

I'm facing the same issue, I truly appreciate if you can share the fix.

Thank You