Caching

Configure caching for API responses

Caching

API Mapper includes built-in caching to improve performance and reduce API calls.

Why Cache?

  • Faster page loads - Cached data is served instantly
  • Reduced API calls - Stay within rate limits
  • Better reliability - Cached data available even if API is down
  • Lower costs - Fewer API requests mean lower costs for paid APIs

Cache Settings

Per-Connection Settings

Each connection has its own cache configuration:

SettingDescriptionDefault
Enable CacheTurn caching on/offOn
Cache DurationHow long to cache (seconds)3600 (1 hour)

Minimum Cache Time by License

Different license tiers have different minimum cache durations:

FeatureFreeLiteProDeveloper
Min. Cache Time60 min30 min1 min1 min
Loading...
Data TypeDurationSeconds
Static content24 hours86400
Product catalog1 hour3600
News/blog posts15 minutes900
Real-time data1-5 minutes60-300
No cache00

How Caching Works

  1. First request fetches from API
  2. Response is stored in cache
  3. Subsequent requests use cached data
  4. After cache expires, fresh data is fetched
Request → Cache exists? → YES → Return cached data
                        → NO  → Fetch from API → Store in cache → Return data

Clearing Cache

Manual Cache Clear

WordPress
  1. Go to Settings → API Mapper
  2. Click Clear Cache on the connection

Clear All Caches

To clear all API Mapper caches at once, use the global Clear All Caches button in settings.

Automatic Cache Invalidation

Cache is automatically cleared when:

  • Connection settings are modified
  • Cache duration expires
  • You manually clear it

Cache Storage

WordPress

Uses the Transients API:

  • Database storage by default
  • Object cache if available (Redis, Memcached)

Troubleshooting

Data not updating?

  • Check cache duration isn't too long
  • Clear the connection's cache
  • Verify cache is actually enabled

Cache not working?

  • Check disk space (for file-based cache)
  • Verify database is writable (for DB cache)
  • Check object cache connection (if using Redis/Memcached)

Best Practices

  1. Set appropriate durations - Match cache time to data freshness needs
  2. Use longer cache for static data - Product images, categories, etc.
  3. Short cache for dynamic data - Stock levels, prices, availability
  4. Monitor API usage - Ensure caching is reducing calls as expected

Was this page helpful?

On this page