All Projects → Rarst → Fragment Cache

Rarst / Fragment Cache

Licence: other
WordPress plugin for partial and async caching.

Projects that are alternatives of or similar to Fragment Cache

Minit
A WordPress plugin to combine CSS and Javascript files.
Stars: ✭ 293 (+117.04%)
Mutual labels:  wordpress, wordpress-plugin, performance
Autoptimize
Official Autoptimize repo on Github
Stars: ✭ 245 (+81.48%)
Mutual labels:  wordpress, wordpress-plugin, performance
Nginx Helper
Nginx Helper for WordPress caching, permalinks & efficient file handling in multisite
Stars: ✭ 170 (+25.93%)
Mutual labels:  wordpress, cache, wordpress-plugin
Pomodoro
A simple WordPress translation cache
Stars: ✭ 47 (-65.19%)
Mutual labels:  wordpress, cache, performance
Wordpress Rest Cache
WordPress Plugin to lazy cache HTTP requests in database and update via cron.
Stars: ✭ 8 (-94.07%)
Mutual labels:  wordpress, cache, performance
Laps
Light WordPress profiler.
Stars: ✭ 368 (+172.59%)
Mutual labels:  wordpress, wordpress-plugin, performance
Redis Cache
A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Credis, HHVM, replication and clustering.
Stars: ✭ 205 (+51.85%)
Mutual labels:  wordpress, cache, wordpress-plugin
Awesome Wp Speed Up
Plugins and resources to speed up and optimize your WordPress site.
Stars: ✭ 375 (+177.78%)
Mutual labels:  wordpress, wordpress-plugin, performance
Performance Improvements For Woocommerce
Performance tweaks for the front-end and back-end of a store.
Stars: ✭ 46 (-65.93%)
Mutual labels:  wordpress, wordpress-plugin, performance
Query Monitor
The Developer Tools Panel for WordPress
Stars: ✭ 1,156 (+756.3%)
Mutual labels:  wordpress, wordpress-plugin, performance
Wp Graphql Yoast Seo
This is an extension to the WPGraphQL plugin for Yoast SEO
Stars: ✭ 120 (-11.11%)
Mutual labels:  wordpress, wordpress-plugin
Gravity Forms Iframe
A Gravity Forms add-on to embed a form in an auto-resizing iframe on external sites.
Stars: ✭ 134 (-0.74%)
Mutual labels:  wordpress, wordpress-plugin
Craft Blitz
Intelligent static page caching for creating lightning-fast sites with Craft CMS.
Stars: ✭ 118 (-12.59%)
Mutual labels:  cache, performance
Wordpress Activitypub
ActivityPub for WordPress
Stars: ✭ 118 (-12.59%)
Mutual labels:  wordpress, wordpress-plugin
Wp Pagenavi
Adds a more advanced paging navigation interface to your WordPress blog.
Stars: ✭ 121 (-10.37%)
Mutual labels:  wordpress, wordpress-plugin
Hyperdrive
This repository has moved to:
Stars: ✭ 120 (-11.11%)
Mutual labels:  wordpress, performance
Antispam Bee
„... another popular solution to fight spam is Antispam Bee“ – Matt Mullenweg, Q&A WordCamp Europe 2014
Stars: ✭ 124 (-8.15%)
Mutual labels:  wordpress, wordpress-plugin
Wponion
~ Lightweight, Flexible & Rapid WP Development Framework ~
Stars: ✭ 125 (-7.41%)
Mutual labels:  wordpress, wordpress-plugin
Wp Sweep
WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.
Stars: ✭ 125 (-7.41%)
Mutual labels:  wordpress, wordpress-plugin
Wp Gfm
WordPress Plugin for PHP-Markdown and GitHub Flavored Markdown
Stars: ✭ 117 (-13.33%)
Mutual labels:  wordpress, wordpress-plugin

Fragment Cache

Scrutinizer Code Quality

Fragment Cache is a WordPress plugin for partial and async caching of heavy front-end elements. It currently supports caching navigation menus, widgets, and galleries.

Caching is built on top of transients API (with enhancements provided by TLC Transients library), provides soft expiration and transparent object cache support.

Installation

Download plugin archive from releases section.

Or install in plugin directory via Composer:

composer create-project rarst/fragment-cache --no-dev

Frequently Asked Questions

Why fragments don't recognize logged in users / current page?

Fragment Cache implements soft expiration - when fragments expire, they are regenerated asynchronously and do not take time in front end page load. The side effect is that it is impossible to preserve context precisely and in generic way.

Fragments that must be aware of users or other context information should be excluded from caching or handled by custom implementation, that properly handles that specific context.

How to disable caching?

Disable handler

Caching for the fragment type can be disabled by manipulating main plugin object:

global $fragment_cache;

// completely remove handler, only use before init
unset( $fragment_cache['widget'] );

// or disable handler, use after init
$fragment_cache['widget']->disable();

Skip individual fragments

Caching for individual fragments can be disabled by using fc_skip_cache hook.

add_filter( 'fc_skip_cache', function ( $skip, $type, $name, $args, $salt ) {

	// Widget by class.
	if ( 'widget' === $type && is_a( $args['callback'][0], 'WP_Widget_Meta' ) ) {
		return true;
	}

	// Menu by theme location.
	if ( 'menu' === $type && isset( $args['theme_location'] ) && 'header' === $args['theme_location'] ) {
		return true;
	}

	// Menu by name.
	if ( 'menu' === $type && isset( $args['menu'] ) ) {

		if ( 'Menu with login' === $args['menu'] ) {
			return true;
		}

		if ( is_a( $args['menu'], 'WP_Term' ) && 'Menu with login' === $args['menu']->name ) {
			return true;
		}
	}

	// Gallery by ID of post.
	if ( 'gallery' === $type && 123 === $args['post_id'] ) {
		return true;
	}

	return $skip;
}, 10, 5 );

License Info

Fragment Cache own code is licensed under GPLv2+ and it makes use of code from:

  • Composer (MIT)
  • Pimple (MIT)
  • TLC Transients (GPLv2+)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].