Menu supplémentaire

Achetez MemberPress dès aujourd'hui ! Commencez à être payé pour le contenu que vous créez ! Obtenir MemberPress maintenant

Configuring API Caching in MemberPress App

API Caching reduces database queries by storing API responses in fast-access memory. This optimization accelerates load times for feeds, menus, pages, and membership content. This document explains how to enable API Caching, verify installation, configure cache settings, and troubleshoot common caching issues.

Understanding API Caching

API Caching stores frequently accessed data in memory rather than querying the WordPress database for each request. The first request retrieves data from the database and caches it. Subsequent requests serve data directly from cache, resulting in faster response times and reduced server load.

Enabling API Performance Component

The API Performance component must be activated before caching configuration can begin.

  1. Naviguez jusqu'à Dashboard > MP App > Components.
  2. Locate API Performance in the components list.
    .
  3. Cliquez sur Activer.

The API Performance component provides caching capabilities and other optimization features for the app.

Verifying Must-Use Plugin Installation

API Caching requires a must-use plugin to function correctly. Verification ensures the plugin is properly installed.

  1. Naviguez jusqu'à Dashboard > Plugins > Must-Use.
  2. Confirm that MP App API Caching appears in the plugin list.

Configuring Cache Settings

Cache settings determine which content types utilize caching functionality.

  1. Naviguez jusqu'à Dashboard > MP App > Settings > API Caching.
  2. Select the checkboxes for content types to cache:
    • MemberPress
    • App Pages  
    • Articles de blog  
    • Blog Comments
    • Blog Categories
    • Post Bookmarks
  1. Cliquez sur Enregistrer les modifications.

Remarque : Each content type can be cached independently based on update frequency and performance requirements.

Managing Cached Data

Cached data must be purged when content updates occur to ensure users see current information.

Purging Individual Cache Items

  1. Naviguez jusqu'à Dashboard > MP App > Settings > API Caching.
  2. Locate the cached content type requiring purging.
  3. Cliquez sur Purge Cache next to the specific item.

Individual cache purging allows selective clearing without affecting other cached content.

Purging All Cached Data

  1. Naviguez jusqu'à Dashboard > MP App > Settings > API Caching.
  2. Cliquez sur Purge All at the top of the caching settings.

All cached data clears immediately, and fresh data populates on the next API request.

Understanding Cache Behavior

API Caching follows a predictable workflow that balances performance with data freshness.

Initial Request Process

When a user first requests cached content:

  1. The API receives the request from the app.
  2. The API queries the WordPress database for the requested data.
  3. The API stores the response in the cache system.
  4. The API returns the data to the user.

This initial request experiences standard database query times.

Subsequent Request Process

After data is cached, future requests follow an optimized path:

  1. The API receives the request from the app.
  2. The API retrieves data directly from cache memory.
  3. The API returns the cached data instantly to the user.

Cached requests complete significantly faster than database queries.

Automatic Cache Purging

Cache purges automatically when content changes occur:

  • New posts or pages are published;
  • Existing content updates or deletes;
  • Membership levels change;
  • Plugin settings are modified.

Automatic purging ensures users receive current data without manual intervention.

Cet article a-t-il été utile ?

Articles connexes

fille de l'ordinateur

Achetez MemberPress dès aujourd'hui !

Commencez à être payé pour le contenu que vous créez.