Skip to content
  • Why WPGetAPI?
  • Examples
  • Pricing
  • Plugins
    • PRO Plugin
    • API to Posts Plugin
    • OAuth 2.0 Plugin
  • Docs
  • Support
    • Frequently Asked Questions
    • Feature Request
    • Support Ticket
  • account_circle
PRO Plugin
Howdy! How can we help you?
  • Introduction

    • Quick Start
    • Frequently Asked Questions
    • Will this work with my API?
    • Understanding API docs
    • Step by Step Example
  • Setup

    • Setup Page
    • Endpoint Page
    • Parameters - Query String
    • Parameters - Headers
    • Parameters - Body POST
    • Shortcode
    • Template Tag
    • Gutenberg Block
  • Connecting your API

    • API Key in Headers
    • API Key in Query String
    • Authentication & Authorization
  • Output API Data

    • Format API to HTML
    • Format API to HTML Table
    • Format API to Image Gallery
    • Format JSON Data
  • Integrations

    • Send form data to API
    • WPForms to API
    • Gravity Forms to API
    • Contact Form 7 to API
    • WooCommerce to API
    • WooCommerce API Product Sync
    • wpDataTables to API
    • Connect WordPress to OpenAI
    • Connect RapidAPI to WordPress
    • Connect Zoho CRM to WordPress
    • Page Builders (Elementor, DIVI)
    • Formidable Forms to API
    • Elementor Form to API
    • JetFormBuilder to API
    • Fluent Forms to API
    • WS Form to API
    • Ninja Tables to API
    • Easy Digital Downloads(EDD) API Product Sync
    • Ultimate Member Forms to API
  • Tips & Tricks

    • Filters & Action Hooks
    • Code Snippets Plugin
    • Troubleshooting
    • Code Snippets
  • PRO Plugin

    • Installation
    • Actions
    • Tokens
    • Caching
    • Nested data
    • Chaining API calls
    • Dynamic Variables
    • Format API to HTML
    • Call API on user registration
    • Using AJAX to trigger API call
    • Base64 Encoding
    • Licensing
    • Filters & Action Hooks
  • OAuth 2.0 Plugin

    • Installation
    • How it works
    • Grant Type - Client Credentials
    • Grant Type - Authorization Code
    • Licensing
  • API to Posts Plugin

    • Installation
    • Getting Started
    • Multiple Endpoints
    • Mapping Fields
    • Filters & Action Hooks
    • Pagination
This feature is only available in the Pro Plugin.

Caching can be done with the Pro Plugin, which adds a field within each endpoint to easily set the cache time of any endpoint.

How to cache API calls

Start by installing the Pro Plugin and a new Cache Time field will be added to each endpoint within the settings of your API(s). Add your required cache time in seconds and then save the endpoint. Simple as that!

Caching external API calls in WordPress

Once caching is setup for an endpoint, the plugin will store the results of your API requests using WordPress transients. Caching will only work for GET requests and it will not cache if there are error messages. It will only cache successful GET requests returned from your API and will also include headers as well as the body in the saved data.

Caching dynamic query variables

Within the Pro plugin, there is the option to use dynamic variables within the query string.

If you set the cache time for an endpoint that is using these dynamic variables, the plugin will dynamically cache the calls to this endpoint. Meaning that a cache will be created for each dynamic variable that is passed to the API. This is important to understand if using this feature and it allows you to continue to use the dynamic variables the way they are intended – to be dynamic – whilst also being able to be cached independently.

A quick example: if you send a query variable such as ?foo=bar and a second query string with ?foo=123, the plugin will pick up that these are different and will create a cache for each one.

Setting the cache time

As mentioned above, the cache time is in seconds. Here are some common times in seconds to help with your caching and to avoid pulling out the calculator:

  • Cache for 1 minute = 60 (duh)
  • Cache for 2 minutes = 120
  • Cache for 5 minutes = 300
  • Cache for 10 minutes = 600
  • Cache for 15 minutes = 900
  • Cache for 30 minutes = 1800
  • Cache for 1 hour = 3600
  • Cache for 2 hours = 7200
  • Cache for 12 hours = 43200
  • Cache for 24 hours = 86400

 

On this page

Unlock amazing features with the PRO Plugin

The PRO Plugin takes your API integrations to the next level.

  View Pro Plugin
contact_support

Still not sure?

APIs can be daunting and sometimes downright confusing.

But we are here to help! Our support is amazing and we can assist you with any setup required and ensure your API integrations are a success!

Ask Us Anything

Connect your WordPress website to external APIs without writing a single line of code. Send data from WordPress to your API or display data from your API within WordPress.

Support

  • Documentation
  • Support Ticket
  • Refund Policy
  • Contact Us
  • About Us
  • Affiliates

Articles

  • Quick Start Guide
  • WooCommerce Orders to API
  • WooCommerce API Products Sync
  • Contact Form 7 to API
  • WPForms to API
  • Gravity Forms to API
  • WordPress to RapidAPI

WordPress API Plugins

  • Free WPGetAPI Plugin
  • PRO Plugin
  • API to Posts Plugin Plugin
  • OAuth 2.0 Authorization Plugin

© 2025 WPGetAPI. All Rights Reserved.

"*" indicates required fields

Name*
This field is for validation purposes and should be left unchanged.