0

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?

1
  • you can do cache management programmatically Commented Aug 26, 2017 at 8:50

2 Answers 2

1
<?php include 'app/Mage.php'; Mage::app(); ini_set('display_errors', 1); Mage::app()->getCacheInstance()->flush(); echo "cleared cache"; ?> 
6
  • root folder ...... Commented Aug 26, 2017 at 8:59
  • 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 Commented Aug 26, 2017 at 9:02
  • ok let me know the status Commented Aug 26, 2017 at 9:07
  • I have to upload few more image to check if it works so I'll let you know the status in a day or two. Thanks once again. I will let you know! Commented Aug 26, 2017 at 9:48
0

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.