This is an old revision of the document!
How to setup crawler cron job for LSCJoomla
Crawler funtion
In the latest LSCJoomla, it provides an crawler function at Advancded → Web interface to rebuild all LiteSpeed Cache:
Web interface to rebuild all LiteSpeed Cache: https://yourdomain.com/index.php?option=com_lscache&recache=5dcfad26ad657984064c731ee774a57f
Pre-requirement for crawler
To run the above crawler, your curl_exec
cannot be disabled in your php.ini setting. Also you will need to enable crawler feature on LSWS which is most likely disabled on shared hosting server by default.
Run crawler once manually
You can click Web interface to rebuild all LiteSpeed Cache link
to run the crawler manually. It will only run once until completion.
Run crawler as cron job
To setup crawler as a cron job, you can simply wget the cachelink URL (please replace the URL with your own value):
wget https://yourdomain.com/index.php?option=com_lscache&recache=5dcfad26ad657984064c731ee774a57f
For example, setup the above cron job daily to run at 0:00, in crontab -e user:
0 0 * * * wget wget https://yourdomain.com/index.php?option=com_lscache&recache=5dcfad26ad657984064c731ee774a57
How to keep the page cached most of the time
The Homepage Public Cache TTL (minutes)
defines how long the cache will be expired. The default settings for it is 2000
minutes, which is around 33 hours.
To keep the page cached most of the time, you can either set longer TTL to make the cache stay longer, or run the crawler periodically before the cache expired TTL. For example, for 2000 minutes TTL, running the crawler cron daily will keep the pages cached all the time.