<?php

ini_set('max_execution_time', 18000);

require_once 'app/Mage.php';

$app = Mage::app('admin'); umask(0); Mage::setIsDeveloperMode(true);

//Cache Refresh Start

$invalidatedTypes = Mage::app()->getCacheInstance()->getInvalidatedTypes();

foreach ($invalidatedTypes as $type) {

      Mage::app()->getCacheInstance()->cleanType($type->getId());

      Mage::log('Cache Type '.$type->getId()." Is Refresh.",null,'Cache_AutoRefresh.log');

}