1

I created the following script and put it to cron job on server. Unfortunately it does not work.

include 'includes/defines.php';
include 'includes/framework.php';

$conf = JFactory::getConfig();

$options = array(
    'defaultgroup' => '',
    'storage'      => $conf->get('cache_handler', ''),
    'caching'      => true,
    'cachebase'    => $conf->get('cache_path', JPATH_SITE . '/cache')
);

$cache = JCache::getInstance('', $options);
$cache->clean('cachegroup');

Do you have an idea what is wrong?

1
  • 1
    Can you provide some details, eg. messages or symptoms, that help people understand what '...does not work' actually means.
    – Irata
    Commented Nov 21, 2022 at 22:04

1 Answer 1

1

An easier way would be to go for the cache cleaner component in Joomla.

It's a lot better as the plugin has compatibility with latest version and can clean cache at intervals too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.