Pods Alternative Cache

Pods Alternative Cache is a file-based or database-based caching solution for hosts that have limitations on object caching.

Pods Alternative Cache

Pods Alternative Cache is a file-based or database-based caching solution for hosts that have limitations on object caching. Pods Alternative Cache provides optimal performance with Pods sites on hosts with no object caching or low limits.

It was developed for and tested against the WPEngine platform to improve performance of cached objects generated from Pods. We recommend those using WPEngine to try out this plugin to see if it helps reduce page load across their site.

Why an Alternative Cache?

Hosts like WPEngine have limits set on their object caching engine that are based on what they find optimal for their environment. Sometimes, plugins, themes, and even WordPress core can utilize object cache to the point where it gets too full. When that happens, certain caching engines like APC can remove objects from their cache and that can cause what appears to be random numbers of queries on each page load.

What Pods Alternative Cache does is store all of the Pods objects that need caching, separate from the default object caching engine. Depending on the environment or site, this may still not be optimal. You’ll want to test things out and keep an eye on your site’s performance to see if it’s the right fit for you.

Using the Alternative Cache In Your Own Plugin Or Theme

Not only can Pods use the Alternative Cache, but you can also take advantage of it by using certain caching functions in Pods. Both sets of the Pods cache and transient functions mirror WP Core’s own functions of similar names, but instead use the Alternative Cache. You can also leverage alternative cache by using pods_view for partial page caching.

pods_cache_set

Adds an item to the object cache.

pods_cache_set ( $key, $value, $group = '', $expires = 0)

The first two parameters are required. The first $key is an identifying name for the item to be cached. The second, $value is the item to be cached itself. The third parameter $group, can be used to assign the item to a group. The last parameter $expire is the maximum length of time that the item will be cached for.

Due to the nature of caching, this is a maximum amount of time, not a guaranteed life-span for the cached item. Any data that you need to ensure will always be set, you should save it to a Pods field or use the Options API.

pods_cache_get

Retrieves a cached item from object cache that was added via pods_cache_set.
pods_cache_get ( $key, $group = '', $callback = null )

The first parameter is required. It corresponds to the key assigned to the item in pods_cache_set(). The optional parameter $callback is the name of a callback function that can be used to create the item if it is not already cached.

pods_cache_clear

Clears an item from the object cache or all items from a cache group.

pods_cache_clear ( $key = true, $group = '' )

The first parameter $key can be set to the name of any items added to the object cache using pods_cache_set(). Alternatively, it can be set to true and all items in a group, who’s name it set with the second parameter $group will be cleared.

pods_transient_set

Adds an item to the transient cache using the Transients API.

pods_transient_set ( $key, $value, $expires = 0 )

The first two parameters are required. The first $key is an identifying name for the item to be cached. The second, $value is the item to be cached itself. The last parameter $expire is the maximum length of time that the item will be cached for.

Due to the nature of caching, this is a maximum amount of time, not a guaranteed life-span for the cached item. Any data that you need to ensure will always be set, you should save it to a Pods field or use the Options API.

pods_transient_get

Retrieves a cached item from transient cache that was added via pods_transient_set().

pods_transient_get ( $key, $callback = null )

The first parameter is required. It corresponds to the key assigned to the item in pods_cache_set(). The optional parameter $callback is the name of a callback function that can be used to create the item if it is not already cached.

pods_transient_clear

Clears an item from the transient cache that was added via pods_transient_set().

pods_transient_clear ( $key = true )

The parameter $key can be used to specify a specific item to clear, or it set to true will clear all transients set using pods_transient_set().

Usage

To clear the Pods Alternative Cache, go to Pods Admin > Clear Pods Cache

To disable the Pods Alternative Cache (default: true):

define( 'PODS_ALT_CACHE', false );

To use the database for the storage instead of the filesystem (default: file):

define( 'PODS_ALT_CACHE_TYPE', 'db' );

To use a different filesystem location to store the cache (default: wp-content/podscache):

define( 'PODS_ALT_FILE_CACHE_DIR', 'path/to/podscache' );

Download and Source Code Links

Other Helpful Documentation on Working with Plugins

Admin Columns and Admin Columns Pro

Add custom fields from Pods to any back-end Admin Column to make the table displays more useful.

Beautiful Taxonomy Filters

Supercharge your custom post type archives by letting visitors filter posts by their terms/categories. Automatically recognizes taxonomy on the archive page and adds filters for it.

Beaver Builder

The best drag and drop WordPress Page Builder. Easily build beautiful home pages, professional landing pages, and more with Beaver Builder.

CIO Custom Fields Importer – Free & Pro Versions

Add-on for WP All Import to process large data sets, includes functionality for Pods Simple Relationships, and Complex Relationships in the Pro Version

Custom Post Type Permalinks

Allows editing the permalinks of any custom post type or taxonomy.

Custom Post Type Widgets

Provides WordPress widgets that work with Custom Taxonomies and Custom Post Types.

ElasticPress

A fast and flexible search and query engine for WordPress.

Elementor

The most advanced frontend drag & drop page builder. Create high-end, pixel perfect websites at records speeds. Any theme, any page, any design.

FacetWP

Advanced Filtering for WordPress: Use FacetWP to add faceted search to your eCommerce sites, resource libraries, listing pages and more.

Gravity Forms

Covers interactions with Gravity Forms and our Pods Add-on for Gravity Forms which allows you to map your Forms to Pods Directly.

Ivory Search

The WordPress Search plugin to power your WordPress site custom search. Helping you build a better search. Includes WooCommerce Search support!

Jetpack

The ideal plugin for stats, related posts, search engine optimization, social sharing, protection, backups, security, and more.

MapPress and MapPress Pro

MapPress adds beautiful, interactive Google or Leaflet maps to WordPress

Members Plugin

One of the most useful free plugin for Managing Roles & Capabilities in WordPress. Provides helpful ways of restricting content both on the back-end and using shortcodes or PHP.

Nested Pages

Nested Pages provides a drag and drop interface for managing pages & posts in the WordPress admin, while maintaining quick edit functionality.

Optin Monster

OptinMonster helps you grow your email list by converting visitors into subscribers and customers. Get more email subscribers now!

Pods AJAX Views

Utilize AJAX cache generation and loading for Pods Views.

Pods Beaver Themer Add-On

Integration with Beaver Builder Themer (https://www.wpbeaverbuilder.com/beaver-themer/). Provides a UI for mapping Field Connections with Pods.

Pods Gravity Forms Add-on

Integrate with Gravity Forms to create a Pod item from a form submission.

Pods SEO

Integrates with WP SEO Analysis for custom fields and Pods Advanced Content Types with WordPress SEO XML Sitemaps

Pods Stream Connector

Integrates with the WordPress Stream plugin to track changes to Pods and content

PolyLang

Making WordPress Multilingual

Post Types Order

Post Types Order allows you to add drag and drop sorting in the admin ui to re-order Post Type Objects and Custom Post Types without additional code.

Related Posts by Taxonomy

This lightweight plugin lets you easily display related posts in a sidebar or after posts as thumbnails, links, excerpts or full posts.

Relevanssi

Relevanssi replaces the default search with a partial-match search that sorts results by relevance. It also indexes comments and shortcode content.

Search and Filter

Search and Filtering for Custom Posts, Categories, Tags, Taxonomies, Post Dates and Post Types

The Events Calendar

The Events Calendar is a carefully crafted, extensible plugin that lets you easily manage and share events. Beautiful. Solid. Awesome.

WooCommerce

WooCommerce is a powerful, extendable eCommerce plugin that helps you sell anything. Beautifully.

WP All Import & Export – Free & Pro Versions

WP All Import & Export is an extremely powerful importer/exporter that makes it easy to import/export any XML or CSV file to WordPress.

WPML

The WordPress Multilingual Plugin

Yoast SEO

Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the Yoast SEO plugin.