To cache automatically via cron?

Hello everyone! Could someone help me solve a bottleneck on the server?

when I post a post to the home page, the cache gets clean and when it first has access, it takes a long time to load the page. How do I cache automatically without having to have the first real access to the page cache?

ee + fc + redis

there are script which can help you out https://patrickmn.com/projects/ocp/

Hello,

you should be able to preload the cache by adding a cronjob like :

* * * * * curl https://yourwebsite.tld > /dev/null 2>&1 

This way, each minute the homepage will be loaded.

1 Like

Cronjon can do only homepage or full site?

With a bash script, it should not be very hard to get the list of pages from the sitemap and to load every page.

I’m using the script:

adding cronjob:

* * * * * php /home/warm-cache/warm.php url=https://mysite.com/page-sitemap.xml sleep=0 key=******** > /dev/null 2>&1

if the page is in the cache, then it is skipped

1 Like