1

i have problem when the cronjob run, the page cache is invalidated after the "Category Products" index is reindexed.

  • this problem happens exactly after each 30min (time of cron job) the FPC become invalidated
  • -there is no changes or updates to products, categories, catalog price rules, static blocks, 3rd party extensions, etc.
  • there is no visitor to website as its under construction
  • there is more than 100K product on website

We use:

  • magento 2.3.4
  • PHP version 7.2
  • mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64)
  • VPS Cloud hosting
  • the cpanel cron job -> https://ibb.co/Wg9v2b1

Any idea/solution? Regards Gabriel

1
  • Magento 2,there should be some code at 3rd party module dodging this
    – Amit Bera
    Jan 25, 2021 at 6:26

1 Answer 1

0

One solution would be to 'warm' the cache for products that require it. Visiting the page using cURL or Wget would do the job or using one of the multitude of 'cache warmer' scripts available online.

Alternatively, a more intelligent method of reindexing, based on necessity, rather than schedule, would stop the cache being cleared unless there has been some change in your catalogue.

I don't know about M2 but in M1 you could selectively reindex based on need

    $processes = Mage::getSingleton('index/indexer')
      ->getProcessesCollection()
      ->addFieldToFilter('status', 'require_reindex')
      ->getColumnValues('indexer_code');
    foreach ($processes as $process) {
      try {
        $process->reindexEverything();
        Mage::dispatchEvent($process->getIndexerCode() . '_shell_reindex_after');
      } catch (Mage_Core_Exception $e) {
        echo $e->getMessage();
      } catch (Exception $e) {
        echo $e;
      }

Your Answer

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

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