Sometime I will implement changes locally and they work fine, I copy them to my remote webserver and the changed are ignored. (The code is identical.)
I go into core
I have found wonderful solution here. I think it should be perfect and working fine. The solution like below:
function _clear_cache()
{
Cache::clear();
clearCache();
$files = array();
$files = array_merge($files, glob(CACHE . '*')); // remove cached css
$files = array_merge($files, glob(CACHE . 'css' . DS . '*')); // remove cached css
$files = array_merge($files, glob(CACHE . 'js' . DS . '*')); // remove cached js
$files = array_merge($files, glob(CACHE . 'models' . DS . '*')); // remove cached models
$files = array_merge($files, glob(CACHE . 'persistent' . DS . '*')); // remove cached persistent
foreach ($files as $f) {
if (is_file($f)) {
try {
@unlink($f);
} catch (Exception $ex) {
$files['errors'][] = $ex->getMessage();
}
}
}
if (function_exists('apc_clear_cache')):
apc_clear_cache();
apc_clear_cache('user');
endif;
return $files;
}
Just use above function in your appcontroller and run that function where you want it will be clear all cache.