Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Quick fix for Magento page cache invalidated problem

by | Nov 24, 2018

Every day I login to Magento Admin panel, I get a message like Magento page cache invalidated. How can i fix this?

That was a recent support ticket we received at our Outsourced Technical Support department where we resolve support queries for web hosting providers.

Magento website owners see the below warning or an alert in their Magento admin panel.

One or more of the Cache Types are invalidated:Page Cache. Please go to Cache Management and refresh cache types.

 

This can be quite frustrating when you see this error every day.

What’s wrong here?

Today, let’s discuss more about the causes of this warning and how our Dedicated Support Engineers fix them.

What’s ‘Page Cache’ and ‘Cache invalidate’?

These are the 2 words that we use frequently in this article.

So, let’s start with the terms “Page Cache” and “Cache invalidate“.

 

Page Cache

Magento uses Full Page Caching to quickly display category, product and CMS pages.

Without caching, a page must run blocks of code and retrieve the information from database each time.

However, with Page cache enabled, this page can be fetched directly from the cache.

As a result, it drastically improves the website performance and server load.

Cache Invalidate

Simply put, this indicates that changes have been made to your site, and the system recognized that these changes don’t match the data in the cache.

Therefore, the system marks the cache contents as invalid.

 

Reasons for Magento page cache invalidated error

Based on our experience dealing with Magento problems, we’ve seen 2 cases where Magento invalidates Page cache and users see this warning.

  • Magento website owners often make changes or updates to products, categories, catalog price rules, static blocks, 3rd party extensions, etc.
  • Website owners use cron jobs in their Magento application to update catalog price rules, currency rates, etc.

 

So, when you make changes to your website, Magento will trigger events.

There are listeners for these events and they identify that the data in database no longer matches the data in the cache.

As a result, this invalidates the cache and displays the warning “One or more of the Cache Types are invalidated“.

 

How to fix Magento page cache invalidated error?

The solution is to clear the Magento cache.

That is, Magento needs to re-build all the cache files anytime a product change is made as part of the core system.

This is to ensure that these changes appear on your site.

Now, let’s see the steps to clear Magento cache.

You can clear the cache in 2 ways – automatically or manually and the exact steps varies depending on the Magento version.

We’ll discuss the steps to clear the cache in Magento 2 and older versions.

 

i) In Magento 2

Our Hosting Engineers clear Magento cache either via Magento admin panel or SSH.

 

Via Magento admin panel

We clear the Magento cache from admin panel using the below steps.

  • Go to System > Cache Management
  • Click on Flush Magento Cache.
  • Further, click on Flush Cache Storage.

 

 

Via SSH

Similarly, we can clear the cache from command line as well.

After logging into user’s account via SSH, we execute the following commands in the Magento installation directory.

php bin/magento cache:clean
php bin/magento cache:flush

 

First command removes all enabled cache related to Magento and second command deletes whole cache irrespective of Magento cache or any third party cache.

 

ii) In Magneto 1.x

Similar to Magento 2, you can clear the cache in Magento 1.x either via admin panel or SSH.

 

Via Magento admin panel

We clear the Magento cache from admin panel using the below steps.

  • Go to System > Cache Management.
  • Click on Flush Cache Storage.

 

Via SSH

Magento stores the cache files in var/cache folder located in the Magento installation directory.

So, to clear the cache, the files in the var/cache directory should be deleted.

Our Hosting Engineers remove the contents from this folder after logging into the user’s account via SSH.

For example, we remove the files from var/cache directory using the below command.

rm -rf var/cache/*

 

For large website owners who make frequent modifications to the site, we suggest to create a cron job(time based job scheduler) to flush the cache.

At Bobcares, we assist our customers in setting up cron job to automatically clear the cache and re-index the site at regular intervals like every 30 mins, every 1 hr and so on.

 

Conclusion

Website owners often face “Magento page cache invalidated” problem when they make changes to products, categories, catalog price rules, etc in their websites. Today, we’ve discussed how our Dedicated Support Engineers fix this problem.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF