To cache automatically via cron?


#1

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


#2

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


#3

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.


#4

Cronjon can do only homepage or full site?


#5

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


#6

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


#7