Building cron-job to recache website
-
I tried to make a cronjob to recache the website automatic, but i don’t get the page cached, only when I launch the page.
If I edit a page, I now launch a FTP-command to delete the cached file (that works), then I want to run a command to recache the page in a batch (cronjob), something like that…
—————
Some examples in my cronjob (these examples don’t work, the page doesn’t get cached)$html = file_get_html(“https://www.kinderfilmpjes.net/kinderseries/kleuter/koek-en-ei”);
$variablee = readfile(“https://www.kinderfilmpjes.net/kinderseries/kleuter/koek-en-ei”);
file_get_contents(‘https://www.kinderfilmpjes.net/kinderseries/kleuter/koek-en-ei’);The page get cached when i run these commands:
header(“Location: https://www.kinderfilmpjes.net/kinderseries/kleuter/koek-en-ei”);When I load this script in a cron-job like:
/usr/bin/wget “https://www.kinderfilmpjes.net/(URL to script)” -O /dev/nullThe header-variant is the only 1 that works, but i can’t make a script with headers in it…
————————-
The question is, how can i reload a page with a php-command? I taught: ‘This should be easy with file_get_contents’ or something, but the page doesn’t get cached that way.I also made a bat-file for the time being… it open and closes google-chrome, but it is not a good soloution to automatic refresh the page.
Example of bat-file:
start chrome.exe https://www.kinderfilmpjes.net/kinderseries/kleuter/buurman-en-buurman
echo 1 / 160. Nog 31.8 minuten
PING 1.1.1.1 -n 1 -w 15000 >NU
taskkill /f /im chrome.exe
start chrome.exe https://www.kinderfilmpjes.net/kinderseries/peuter/woezel-en-pip
echo 2 / 160. Nog 31.6 minuten
PING 1.1.1.1 -n 1 -w 15000 >NU
taskkill /f /im chrome.exeI hope you understand my question ?? My website has so many pages, I cannot just delete the whole cache.
Note: The solution after the new updates works like a charm (with the adsense-problem)!! Tnx… I was on a holiday, so i didn’t saw your question.
- The topic ‘Building cron-job to recache website’ is closed to new replies.