WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] WordPress SEO SItemap to preload cache (10 posts)

  1. svenm73
    Member
    Posted 2 years ago #

    Hello,

    I am using W3 Total cache and the Yoast WordPress SEO Plugin.

    To preload the cache I want to use the sitemap generated by the SEO plugin which is a different (http://www.example.de/sitemap_index.xml) from the Sitemap generated by the "Google XML Sitemaps" plugin and according to W3 Total cache not compliant.

    Can I still use it or is there a workaround?

    thanks and best regards
    Sven

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. naifamoodi
    Member
    Posted 2 years ago #

    I couldn't get the W3TC plugin's preloader to work with a sitemap index. I couldn't get it to run with google XML sitemaps plugin either. Because I have a VPS, I set up Optimus Cache Prime instead to preload the cache.

  3. Patrick Mylund Nielsen
    Member
    Posted 2 years ago #

    Hi Sven,

    Optimus Cache Prime does indeed, as Naifamoodi said, support sitemap index files. It will prime all of the URLs contained within each of the sitemap files that the sitemap index refers to. It can be run from any Windows or Linux box--it doesn't have to be used on the server itself.

    An example from an external machine:

    ./ocp http://example.com/sitemap_index.xml

    Example with W3 Total Cache when running locally on your server:

    ./ocp -l /var/www/example.com/wp-content/w3tc/pgcache -ls _index.html /var/www/example.com/sitemap_index.xml

    The advantage of running it locally with something similar to the second example is that OCP checks whether the pages are already cached, and only primes the ones that aren't, resulting in fewer requests to e.g. Apache.

  4. Patrick Nommensen
    Member
    Posted 2 years ago #

    This sounds like a great resource - the Optimus Cache Prime. How do I go about using this on a Windows 7 machine once I've downloaded the application to my pc? I also have a Yoast/WordPress SEO sitemap.

    Many thanks!!

  5. Patrick Mylund Nielsen
    Member
    Posted 2 years ago #

    Hi pnommensen,

    The easiest way is probably via a shortcut:

    • Download the latest Windows zip file from the OCP page
    • Right-click the zip file and select "Extract All..." -> Extract
    • Open the extracted folder "ocp"
    • Right-click ocp.exe and click "Create shortcut"
    • Call the shortcut something descriptive like "Prime example.com sitemap"
    • Right-click the shortcut, click Properties, and change the target from e.g.
      "F:\Downloads\ocp-2.3\ocp\ocp.exe"
      to
      "F:\Downloads\ocp-2.3\ocp\ocp.exe" http://example.com/sitemap.xml
      (it's important that there are double quotes around the path to ocp.exe)
    • Click OK, and then, whenever you want to prime the site, just click the shortcut

    If you want to run it on a schedule, you can add a task to run the shortcut on a certain schedule via Windows' Task Scheduler (taskschd.msc).

    There are many options you can use. (For example, by default it doesn't show any information about what it's doing -- you could add "-v" to the target line to make it more verbose.) If you want to see all of the available options, hold down shift and right-click somewhere in the folder containing OCP, select "Open command window here", then type "ocp.exe"

    Hope that helps!

  6. Patrick Nommensen
    Member
    Posted 2 years ago #

    That was easy, thanks!!

  7. Patrick Nommensen
    Member
    Posted 2 years ago #

    Just out of curiosity: Couldn't anyone re build the cache of any site out there if they know the link to their sitemap? It seems like there should maybe be some verification.

  8. Patrick Mylund Nielsen
    Member
    Posted 2 years ago #

    If they wanted to. The only thing OCP really does is it reads the publicly available sitemap file that the site author has created, and crawls the site just like a search engine spider which has read the sitemap would, making normal GET requests for each of the URLs in the sitemap. (Basically the same as if you opened the sitemap.xml file in your browser and manually clicked every link.) Each GET request prompts the server to use whatever caching mechanism(s) it has in place, e.g. W3 Total Cache or WP-Super-Cache. OCP doesn't decide what mechanism to use, nor how it should be used.

    It wouldn't really be possible to have verification and keep OCP in its current form, a stand-alone piece of software. Besides, if somebody wanted to use it maliciously to e.g. perform a DoS attack, there are much "better" tools that they could use--ones that don't care about sitemaps at all.

    If people receive unwanted hits from OCP, they can block the IP address of the person(s) using the tool, or block the user-agent, "Optimus Cache Prime", itself.

  9. svenm73
    Member
    Posted 2 years ago #

    Hi Patrick,

    thanks a lot for your response. I am still a bit lost ... I do not own a windows PC and I don´t know anything about Linux – shame on me ...

    To install it on the Server where my wordpress installation is running – do I need root for that?

    Thanks and best regards
    Sven

  10. Patrick Mylund Nielsen
    Member
    Posted 2 years ago #

    Hi Sven,

    No root necessary, but do you do need shell access, e.g. via "ssh" in OS X. From the shell, you can do something like:

    (Copy the 32-bit or 64-bit link from the Optimus Cache Prime page depending on the architecture of your server. If you're not sure which it is, you can try both of them--one of them will work.)

    1. wget <link>
    2. tar xfvz ocp-x.x-xxxxx.tar.gz
    3. cd ocp
    4. ./ocp http://example.com/sitemap.xml

    If you don't have shell access/can't run commands on the server, e.g. if it's a shared hosting environment, there's no easy way to run OCP.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic