script for open all pages of my website

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:

  1. I make little changes and upload to the production environment.
  2. I clean cache
  3. Now when each page, post, of WordPress is visited for the first time, it loads very slowly (is the first time)
  4. 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?

Related posts

Leave a Reply

3 comments

  1. 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.

  2. (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:

    wget -R -np http://www.yoursite.com
    

    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.