tokkonopapa / WP-Super-Preload

This plugin helps to keep whole pages of your site always being cached in the fresh based on the sitemap.xml and your own settings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WP Super Preload

This plugin helps to keep whole pages of your site always being cached in the fresh based on the sitemap.xml and your own settings.

Description:

You might use one of caching plugin such as WP Super Cache, W3 Total Cache, Hyper Cache or Quick Cache to make your site response fast.

But every caching plugin has a process called 'garbage collection' which will remove old expired caches.

Wikipedia says:

If requested data is contained in the cache (cache hit), this request can be served by simply reading the cache, which is comparatively faster. Otherwise (cache miss), the data has to be recomputed or fetched from its original storage location, which is comparatively slower.

This plugin keeps every page always being cached and improves the cache hit ratio. As a result, your visitors always feel your site so fast.

It crawls your site based on sitemap.xml (ex: Google XML Sitemaps) and selected pages such as front pages, fixed pages, categories, tags and so on, in order to keep page caches always being fresh.

Requires WordPress 3.1.0 or higher and PHP 5 with libcurl.

Features:

  1. Preloading synchronized with garbage collection of your caching plugin.

  2. Using 'curl_multi' PHP functions to crawl pages in parallel. It makes expiration time aligned in a short period of time.

  3. Split preloading is supported to reduce the load of your server.

Installation:

  1. Upload wp-super-preload to the /wp-content/plugins/ directory,
  2. Activate the plugin through the 'Plugins' menu in WordPress.

Settings:

Basic settings

  • Trigger at the garbage collection WP-Cron event :
    To enable this plugin, select one of event to fit your caching plugin.

  • Trigger at the scheduled WP-Cron event :
    If you want an additional event, please select period.

  • URLs of sitemap :
    Typically, http://example.com/sitemap.xml.

  • Additional contents :
    Selection of additional pages that are not on the sitemap.

  • URLs of additional pages :
    Individual pages that are not on the sitemap.

  • Maximum number of pages :
    Limit the number of pages to be preloaded.

  • Additional UA string :
    Typically, iPhone.

Advanced settings

  • Split preloading :
    Split the number of pages to reduce the server loads.

  • Number of requests per split :
    Maximum number of pages per each split.

  • Number of parallel requests :
    The number of pages to be fetched in parallel.

  • Interval between parallel requests :
    Interval in millisecond for parallel requests.

  • Test preloading :
    You can find the execution time and the number of pages that are preloaded.

Event of garbage collection

Cache Plugin   | Event Name
---------------|------------------------------------------------
WP Super Cache | `wp_cache_gc`
W3 Total Cache | `w3_pgcache_cleanup`
Hyper Cache    | `hyper_clean`
Quick Cache    | `ws_plugin__qcache_garbage_collector__schedule`

You can find these enents by using WP-Cron Dashboard, Cron View, or Debug Bar & Debug Bar Cron.

Tips for split preloading

If you have 1000 pages to be cached and the expiration time is 3600 seconds, you can set the garbage collection interval to 600 seconds (in your caching plugin's settings) and 200 pages to be requested in each garbage collection (in this plugin's settings).

Notice:

Current version doesn't support recursive sub-sitemap. So it can not be used with WordPress SEO by Yoast which makes sub-sitemap.

Recommendation:

Similar plugins:

Todo:

  • make it into plugin. (0.1)
  • tightly synchronize with garbage collection via WP-Cron functions. (0.1)
  • add Advanced settings. (0.2)
  • add Preload now button. (0.3)
  • additional urls or sitemaps. (0.4)
  • limit the number of pages to be preloaded. (0.5)
  • split preloading. (0.5)
  • additional crawling with smart phone UA. (0.6)
  • additional contents selection. (0.6)
  • separate read/write db from read only option table (0.6)
  • check php and WordPress version for compatibility. (0.7)
  • handle errors and exceptions. (0.8)
  • internationalization and localization. (0.8)
  • preloading test by ajax. (0.9)
  • add scheduled time event. (0.9)
  • add a version number. (1.0)
  • add README.txt. (1.0)
  • support recursive sitemap.

Checked plugins:

License:

Licensed under the GPL v2 or later.

References:

About

This plugin helps to keep whole pages of your site always being cached in the fresh based on the sitemap.xml and your own settings.


Languages

Language:PHP 98.2%Language:JavaScript 1.8%