TOPIC: Correctly setup of recache.php cron job

Correctly setup of recache.php cron job 04 May 2017 06:04 #1920


I was trying to setup cron_recache.php a few days ago with no success. Ours is a very large dynamic listing website with almost 40000 listing in arround 50 categories and with around 80000 users.

What we want is to serve always a cached version of the pages because a non-cached category view loads in around 3.5s and a cached version of the same page in less than 1.5s.

What we tried was to execute cron_recache.php filtering with $JotcacheRecacheWhere by "com" column using our extension for listing, so it will refresh expired pages for our listing component. We set the cronjob to run the script each 5 minutes, but a couple of hours later we had 10 process running at the same time, consuming almost all the ram of our server. Because at the begining we had just a couple of thousands cached pages everything works fine in the first execution but a hours later we had so many expired pages in cache that the recache process can not be able to refresh all of them before the next five minutes, so the next call happends.

I really dont know how can we reach our goal, but any idea or help would be great!

Regards and sorry for my poor english,

Joomla version : 3.6
JotCache version : 5.3.2
site template:
system plugins :
The administrator has disabled public write access.

Correctly setup of recache.php cron job 04 May 2017 07:48 #1921

Usually in the case as you described is necessary to do:

1. prevent to cache unnecessary/problematic URLs (e.g. to set .htaccess redirect that only HTTP protocol and domain which are preferred are processed in Joomla). You can also set JotCache plugin parameter Multisite to YES and further to set Domain Filter. Also when you are using some methods for traffic tracing e.g. Google UTM parameters you need to set JotCache plugin parameter Exclude URLs with Query String to YES.

2. narrow the scope of cached pages only to most important for web site evaluation and use. Here you can use JotCache plugin parameter URL Cache Selection with INCLUDE mode. Then are cached only pages which have rules on Include URL page (JotCache component).

3. use cron recache with interval which can be safely processed in one run. When you split cached pages in more groups with different expiration time (JotCache plugin parameter Extra Cache Lifetimes and JotCache component Extra Cache Lifetimes page) then you can also use more cron jobs with different intervals for recaching of each of group.
The administrator has disabled public write access.
Time to create page: 0.225 seconds
We have 72 guests and one member online
Copyright © 2015 JotComponents
We have 72 guests and one member online
Copyright © 2018 JotComponents