WP Fragment Cache

Improve website performance by caching individual page fragments (widgets, menus output and long loops).

Author:Marius Dobre (profile at wordpress.org)
WordPress version required:3.7.0
WordPress version tested:3.9.1
Plugin version:1.0.4
Added to WordPress repository:26-04-2014
Last updated:18-06-2014
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:https://github.com/mariuspass/WP-Fragment-Cac...
Total downloads:1 298
Active installs:10+
plugin download
Click to start download

This plugin requires PHP version 5.3.6 or greater and can't be activated without a persistent backend for the WordPress Object Cache.

Adds ability to cache particular sections of your site. This plugin is for people who can't use a full page cache or for sites with lots of pages and with frequent changes. It can cache entire loops with the WP_Query(bypassing the database queries) or only the html output of the loop and if the query results has changed(comment added, post was edited, postmeta has changed ...) the cache will be invalidated and regenerated.

Example usage:

<?php if ( ! WP_Fragment_Cache::output( $wp_query_or_blockname, $duration ) ): ?>

  //content to be cached

  <?php WP_Fragment_Cache::store(); ?>
<?php endif; ?>

Parameters:

$wp_query_or_blockname (mixed/string) (optional) a WP_Query(WP_Comment_Query) result or a string. Default: the file and the line where the call was initiated(e.g. widgets/most-commented.php:18).

$duration (int/string) (optional) Defines how many seconds to keep the cache for. If you pass 0 the cache will not expire. If you pass the string "only_today" the cache will expire at the end of the current day. You can use WordPress Time Constants. Default: 86400 (one day).

Advanced usage:

See the wiki pages on GitHub


FAQ
ChangeLog