General informations about JotCache extension

TOPIC: Recache plugin & Cron

Recache plugin & Cron 21 Feb 2015 18:20 #1225

Hi,

I like your component/plugin very much.

I would like to understand how the recache plugin in cron job works, because when it is started, it recaches the pages randomly, but it never recahces them all.

I have around 5000 pages cached with crawlertext plugin and I have also the recache cron setup. When the plugin starts running it recaches maximum around 400 pages. That still would be great, if it recaches from the oldest to the newest, because I just then would run the recache plugin every hour. (btw. I have recache timout set to 28800)

So here are my questions:
1) the principle how recache chooses the pages what to recache?
2) is there a way to run "crawlertext" via cron ?
3) Are there any special settings I could set to let the recache plugin go through the whole list of all cached urls?

Thank you a lot for your answer.

Tom

Joomla version : 3.3
JotCache version : 5.0.4
site template: Custom
system plugins :
The administrator has disabled public write access.

Re: Recache plugin & Cron 22 Feb 2015 10:23 #1226

JotCache has three possibility to refresh cached pages to the latest content:
- recache (refresh only pages which are already in page cache (expired and not-yet-expired))
- crawler, crawlerext (goes through page links and requests each link to load)
Difference between crawler and crawlerext is only in way how site pages are scanned.

When you like to refresh pages already stored in the cache then it is necessary to use 'recache' plugin.
Use in cron_recache.php :
define('JOTCACHE_PLUGIN_NAME', 'recache');
1. Recache with recache_cron.php allows selective recaching with setting value of column 'recache' in DB table #__jotcache to value '1' for all pages which have to be recached.

For recache 100 newest cached pages modify code in cron_recache.php in following way >

original code :
$query = $db->getQuery(true);
  $query->clear();
  $query->update($db->quoteName('#__jotcache'))
          ->set('recache=1');
new code :
$query = $db->getQuery(true);
  $query->clear();
  $query->update($db->quoteName('#__jotcache'))
          ->set('recache=1')->order('`ftime` DESC LIMIT 100');
2. Yes it is possible - set code to (take care to write 'crawlerext' and not 'crawlertext'):
define('JOTCACHE_PLUGIN_NAME', 'crawlerext');
3. Any recache process is limited in process time with parameter setting 'max_execution_time' in php.ini.

N.B. Some additional information to cron setting with EasyCron you can find in JotCache help kbase.jotcomponents.net/jotcache:help:v50j3x:joteasycron
The administrator has disabled public write access.

Re: Recache plugin & Cron 27 Feb 2015 12:35 #1250

Thank you very much for your answer.

I used your options and it worked great until...

The problem I have is, that my hosting company uses "wget" for running crons.

I commented out the cli condition from the recache file, but the thing is, that sometimes the cron is ran once, but sometimes 10 to 20 times and it floods the server CPU.

Is there a way to run the cron only once using the wget or to add some kind of a condition, if there is already a recache plugin working to not run it again?

Thank you very much!

Joomla version : 3.3
JotCache version : 5.0.4
site template: custom
system plugins :
The administrator has disabled public write access.
Time to create page: 0.249 seconds
We have 85 guests and no members online
Copyright © 2015 JotComponents
We have 85 guests and no members online
Copyright © 2017 JotComponents