eSolutions & marketingeSolutions & marketing
  • Home
  • Website Solutions
    • eCommerce Solutions
    • Website Design / Development
    • Shopping Cart Software
    • Content Management Systems
    • Shopfront to WooCommerce
    • Website Sale
    • Web Development Quotation
  • Website Services
    • Website Support & Maintenance
    • Fraud Protection Software
    • Google Merchant Feeds
    • Project Management
  • Internet Marketing
    • Google Maps / Google Business Profile
    • Search Engine Marketing
    • Search Engine Optimisation
  • Our Work
  • Post a Project
  • Contact
  • Home
  • Website Solutions
    • eCommerce Solutions
    • Website Design / Development
    • Shopping Cart Software
    • Content Management Systems
    • Shopfront to WooCommerce
    • Website Sale
    • Web Development Quotation
  • Website Services
    • Website Support & Maintenance
    • Fraud Protection Software
    • Google Merchant Feeds
    • Project Management
  • Internet Marketing
    • Google Maps / Google Business Profile
    • Search Engine Marketing
    • Search Engine Optimisation
  • Our Work
  • Post a Project
  • Contact

  • Home
  • Our Insights
  • Magento invalidated cache can slow down the website

Magento invalidated cache can slow down the website

Posted by: esolutions-and-marketing Category: Development

esolutions-and-marketing2021-07-27T09:53:15+10:00

Magento invalidated cache can slow down the website

By esolutions

Last week, one of our client’s website which is running on Magento became noticeably slow. Using Chrome developer’s tool it shows the page load took 14+ seconds and even longer. So we started to investigate the issue and we were a little surprised to find out the cause of the slowness.

Luckily we run all our own servers so it didn’t take long to track the problem down.

  • First thing we checked was the server it was hosted on, to see if it was a resource issue. The server load was average and MySQL didn’t seem to have any problems. Also no resources were limited on that domain so we concluded that it wasn’t a resource problem on the account or globally on the server.
  • Next we had a discussion between our developers and confirmed there were programming done on the website. This means this must be caused by the Magento core or some plugins this website is using.
  • At this stage, we suspected maybe the caching was turned off, so we went into cache management to check.
    Magento Cache Management
    Caching was on but we discovered that there was an invalided cache.
    Magento Invalided Cache
  • So we selected the invalided cache and refreshed it.
    Magento Refresh Invalided Cache
  • After this we tested the website again. To our surprise, this resolved the websites’s slow loading issue. Now we need to find a way to detect this and fix it automatically.
  • To do this, we created a file called cache-check.php in the root of the Mangeto directory. In our case, it is the public_html. This file consist of the following codes:<?php
    require ‘app/Mage.php’;
    $invalidCache = Mage::app()->getCacheInstance()->getInvalidatedTypes();
    foreach($invalidCache as $i)
    {
    Mage::app()->getCacheInstance()->cleanType($i[“id”]);
    }
  • Next we added a cron in cpanel to run this every hour. Now the system will check for invalided cache and refresh it every hour. We can set this to a smaller interval if we want, but hourly check should be sufficient.

Hope this may help someone out with a similar problem.

Recent Posts

  • We asked ChatGPT “Where Do You See AI Helping Business in the Future?” October 10, 2024
  • Unveiling the Benefits of Professional Website Design for Your E-commerce Venture in Sydney April 15, 2024
  • The Vital Importance of Keeping WordPress Plugins Up to Date April 2, 2024

Categories

  • Blog
  • Develop
    • Design
  • Development

Let’s Get in Touch

We’re interested in talking
about your business.

Let's Talk!

  • Castle Hill, Norwest & The Hills
  • Parramatta
  • Hornsby & Sydney’s North West
  • Silverwater & Sydney Olympic Park
  • West Ryde & Macquarie Park
  • Blacktown & Seven Hills

Useful Links

  • Website Design Sydney
  • About
  • Sitemap
  • Terms
  • Contact
esolutions and marketing
Facebook Twitter Linkedin
© 2025. All Rights Reserved