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:
| Setting | Description | Default |
|---|---|---|
| Enable Cache | Turn caching on/off | On |
| Cache Duration | How long to cache (seconds) | 3600 (1 hour) |
Minimum Cache Time by License
Different license tiers have different minimum cache durations:
Recommended Cache Durations
| Data Type | Duration | Seconds |
|---|---|---|
| Static content | 24 hours | 86400 |
| Product catalog | 1 hour | 3600 |
| News/blog posts | 15 minutes | 900 |
| Real-time data | 1-5 minutes | 60-300 |
| No cache | 0 | 0 |
How Caching Works
- First request fetches from API
- Response is stored in cache
- Subsequent requests use cached data
- After cache expires, fresh data is fetched
Clearing Cache
Manual Cache Clear
WordPress
- Go to Settings → API Mapper
- 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
- Set appropriate durations - Match cache time to data freshness needs
- Use longer cache for static data - Product images, categories, etc.
- Short cache for dynamic data - Stock levels, prices, availability
- Monitor API usage - Ensure caching is reducing calls as expected
Was this page helpful?