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.

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;
}
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.