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.
<?php if ( ! WP_Fragment_Cache::output( $wp_query_or_blockname, $duration ) ): ?> //content to be cached <?php WP_Fragment_Cache::store(); ?> <?php endif; ?>
(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).
(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).
See the wiki pages on GitHub
- You should have a persistent backend for the WordPress Object Cache enabled. This plugin can’t be activated without a persistent cache.
- Download the plugin and unzip.
- Upload them to
/wp-content/plugins/directory on your WordPress installation.
- Then activate the WP Fragment Cache plugin from Plugins page.
- Edit your template files to include WP Fragment Cache. See the Description tab
Non ci sono recensioni per questo plugin.
Contributi e sviluppo
“WP Fragment Cache” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.Collaboratori
Changelog (registro delle modifiche)
- PHP 5.3 compatibility fix.
- Make PHP version 5.3.6 minimal requirement.
- Fix example usage code block.
- Improve the description of the persistent cache requirement to avoid any confusion.
- Add README and CHANGELOG.
- Add link for Advanced usage.
- Initial release.