Optimizing Performance with API Caching #
Every search page and detail page makes API calls to your shelter management system. On high-traffic sites, this can slow page loads and hit API rate limits. Caching stores responses temporarily so repeat requests are served instantly.
When to Enable Caching #
- High traffic sites: More than a few hundred daily visitors – caching prevents API bottlenecks
- Slow API responses: If pages take more than 2-3 seconds to load, caching helps immediately
- Multiple shortcodes per page: A homepage with carousel + compact = multiple API calls per visit
- Featured/homepage displays: These pages get the most traffic and benefit most from caching
Recommended TTL Settings #
| Cache Type | Recommended TTL | Why |
|---|---|---|
| Search Results | 5 minutes | Balances freshness with performance. New arrivals appear within 5 minutes. |
| Detail Pages | 15 minutes | Individual animal data changes less frequently. Longer cache is safe. |
Configure in admin: General > Performance.
Caching + Client-Side Filtering #
The best performance comes from combining API caching with client-side features. When enabled, the initial page load fetches data from cache, and filter/sort interactions happen instantly in the browser without additional API calls:
[pmp-search type="adopt" filter="enable" client="enable"]
Cache Clearing #
If you need fresh data immediately (e.g., after a large intake or data correction), clear the cache in admin: Tools > Cache Management. The cache also regenerates automatically after the TTL expires.
Tips #
- Start with the recommended TTLs and adjust based on your update frequency
- Homepages with carousels benefit most – visitors see instant results on repeat visits
- Cache is per-shortcode, so different pages can have different effective freshness
- If animals appear stale, check Stale Content / Cache Issues for troubleshooting
- API caching requires Junior license or higher
Next Steps #
- Performance & Caching Reference — Full caching configuration details
- Stale Content / Cache Issues — Troubleshooting cached data
- Featuring Animals on Your Homepage — High-traffic pages that benefit from caching
Optimizing Performance with API Caching
ultima modifica: 2026-03-29T09:52:56-04:00
da