I have one website made with WordPress. I installed the plugin “cache quick” in order to optimize it.
Now it loads faster.
But I have the little issue, which is:
- I make little changes and upload to the production environment.
- I clean cache
- Now when each page, post, of WordPress is visited for the first time, it loads very slowly (is the first time)
- Then, I try to visit all the links of the website to cache them, and so serve the users quickly, with latest changes.
I have thought to make a script to do this for me 🙂
Anyone can help me, please?
One of the methods to rebuild a cache is to write a crawler commandline script. It will read all URL’s from your database and then uses curl to hit them. You can have this script have intervals between hits to save server capacity as well as have it cronned as to run every hour or so.
If you prefer doing it manually you can create a plugin that reads all url’s and hits them each after each other. Functionality in fact is the same.
(I would write this in a comment, unfortunately I don’t have enough reputation.)
If I understand correctly you want to visit your main page and all pages ‘below’ in the hierarchy.
Then assuming you have some unixoid system available I would suggest you use something like this on the command line:
Read the man pages of wget to see what those flags do and which flags you actually need. You can also follow links in your domain and stuff like that.
If you want to do this on a regular timebasis you can use cron. And maybe after downloading everything you should rm all the stuff you downloaded.
You may try some grabber and after that take a look that your cache is build or not.
you may use http://www.httrack.com/ this will request all links on your website.
I hope this helps.