I often get this question about Pubwich:
What is the cronjob for? Do I really need it?
The real answer is “no“. However, there are drawbacks for not using the cronjob. Here’s how Pubwich’s caching system works:
- A user visits a Pubwich installation on http://example.com.
- Pubwich checks if there already is data in its cache folder and checks if this data is not expired.
- If there’s no data or if the data is expired, Pubwich fetches the data from the web services (while the user waits…) and then display it.
- If there is data and it’s not expired, Pubwich display it and the user doesn’t have to wait.
The cronjob’s job is to prevent #3 from happening by fetching the data each X minutes to make sure that the data is always fresh and that the end-user will never have to wait for Pubwich to fetch the data.
If your cache time limit (defined in is /cfg/config.php) is set 20 minutes, set your cronjob to run each 15 minutes, so the 20 minutes limit will never be reached.
So the real answer is “yes, to make sure that your visitors never have to wait“.