2

I had FPC (full page cache) enabled There is one category containing subcategories and 900+ products. It was working fine but suddenly it started pushing 500 internal server error. I have not add any new product or any major change. so now when I disable the FPC, the category start working and when I re-enable FPC, again internal server error 500.

I have already applied couple of solutions but no success. tried with removing cache at all, reindexing, crons, have check the htaccess also all things are fine, I had try with creating new category but when I assigned the same block to load on that category, again same issue started.

Log is saying that The problem is in the function getIdentities()

Can anyone help with this? thanks in advance.

Ronak Chauhan
6,2133 gold badges31 silver badges67 bronze badges
asked Dec 21, 2016 at 9:56

2 Answers 2

1

I had same problem and I managed to solve it by overriding the function getIdentities() in \Magento\Catalog\Block\Product\View. It works for me.

From

public function getIdentities()
{
 $identities = $this->getProduct()->getIdentities();
 $category = $this->_coreRegistry->registry('current_category');
 if ($category) {
 $identities[] = Category::CACHE_TAG . '_' . $category->getId();
 }
 return $identities;
}

To

public function getIdentities()
{
 $identities = [];
 if (is_array($this->getItems()) || is_object($this->getItems()))
 {
 foreach ($this->getItems() as $item)
 {
 $identities = array_merge($identities, $item->getIdentities());
 }
 }
 return $identities;
}
answered Sep 15, 2017 at 7:33
0

finally i found the issue, here is the issue. if we have bulk of products in any category, we can either enable varnish cache or FPC (full page cache)

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

answered Dec 22, 2016 at 10:14

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.