Every single time I am trying to upload a few photos, the Cache says "One or more of the Cache Types are invalidated: Blocks HTML output. Click here to go to Cache Management and refresh cache types." I know that you can go in and select all to refresh or flush, but if I try to go to the cache management page or any page in the website, a white page saying "This page isn’t working" pops up until I clear the cache through cpanel FTP or wait for a good few minutes to reload the page. Is there any solution to this?
2 Answers
<?php
include 'app/Mage.php';
Mage::app();
ini_set('display_errors', 1);
Mage::app()->getCacheInstance()->flush();
echo "cleared cache";
?>
-
-
-
I know it's in the root folder, but which file do I have to insert this code to? Commented Aug 26, 2017 at 9:00
-
you have to create a new file for this ex: clearcache.php in browser you have to run website.com/clearcache.php– RaghuCommented Aug 26, 2017 at 9:02
-
Answering the question assuming you are using Magento 1.
Check function invalidateType in file app/code/core/Mage/Core/Model/Cache.php
This function marks the cache as invalidated. You can hook the code of this function to clean the cache instead of marking it as invalidated.
I hope it will help.