Menu adicional

Obtenha o MemberPress hoje mesmo! Comece a ser pago pelo conteúdo que você cria! Obtenha o MemberPress agora

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. Navegue até Dashboard > MP App > Components.
  2. Locate API Performance in the components list.
    .
  3. Clique em Ativar.

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. Navegue até 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. Navegue até Dashboard > MP App > Settings > API Caching.
  2. Select the checkboxes for content types to cache:
    • MemberPress
    • App Pages  
    • Publicações do blog  
    • Blog Comments
    • Blog Categories
    • Post Bookmarks
  1. Clique em Salvar alterações.

Observação: 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. Navegue até Dashboard > MP App > Settings > API Caching.
  2. Locate the cached content type requiring purging.
  3. Clique em Purge Cache next to the specific item.

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

Purging All Cached Data

  1. Navegue até Dashboard > MP App > Settings > API Caching.
  2. Clique em 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.

Este artigo foi útil?

Artigos relacionados

garota do computador

Obtenha o MemberPress hoje mesmo!

Comece a ser pago pelo conteúdo que você cria.