Performance & Caching Best Practices #
PetMatchPro fetches animal data from external APIs, so caching plays an important role in page load speed. This guide covers how to optimize performance and work with common caching systems.
PetMatchPro API Caching #
Requires Junior license or higher.
PetMatchPro can cache API responses so it doesn’t call your partner’s API on every page load. Configure this in General Options:
- API Cache Enabled — Turn caching on/off
- Cache TTL (Time to Live) — How long cached data is valid before refreshing
Cached data is stored as WordPress transients. When the cache expires, PetMatchPro fetches fresh data from the API on the next page load.
OPcache #
OPcache is a PHP bytecode cache that speeds up PHP execution. It’s enabled on most web servers by default.
The Issue #
When you update PetMatchPro settings or upload a new plugin version, OPcache may continue serving the old compiled PHP files. This means your changes don’t appear even though they’ve been saved.
How to Clear OPcache #
- cPanel: Look for “PHP Configuration” or “OPcache” in your hosting control panel
- Hosting dashboard: Many managed hosts have a “Clear Cache” button
- Contact your host: Ask them to clear OPcache or restart PHP-FPM
LiteSpeed Cache #
LiteSpeed is a web server used by many WordPress hosts. Its caching can be aggressive.
Recommended Settings #
- Exclude PetMatchPro pages from page cache — Search pages with filters and detail pages with dynamic content should not be fully cached
- Purge after updates — Purge the LiteSpeed cache after changing PetMatchPro settings
How to Purge #
- If using the LiteSpeed Cache WordPress plugin, go to LiteSpeed Cache > Toolbox > Purge All
- Or add your PetMatchPro pages to the “Do Not Cache” list in LiteSpeed settings
CDN Caching #
If you use a CDN (Cloudflare, StackPath, KeyCDN, etc.), it may cache your animal pages.
Recommended Configuration #
- Exclude dynamic PetMatchPro pages — Create a page rule or cache exception for your search and detail page URLs
- Allow CSS/JS caching — PetMatchPro’s static assets (stylesheets, scripts) can be safely cached
- Purge after updates — Clear the CDN cache when you update PetMatchPro or change settings
WordPress Object Cache #
If you use a persistent object cache (Redis, Memcached), PetMatchPro transient data will be stored there instead of the database. This is generally fine and can improve performance. Just be aware that flushing the object cache also clears PetMatchPro’s cached API data.
Browser Caching #
Visitors’ browsers may cache PetMatchPro pages. If a visitor doesn’t see updated animals:
- Hard refresh the page: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac)
- Clear the browser cache
- Try an incognito/private browsing window
Performance Tips #
- Enable API caching (Junior+) to reduce API calls and speed up page loads
- Use result limits to avoid loading hundreds of animals at once
- Enable pagination to split large result sets across multiple pages
- Use the right template — simpler templates with fewer fields load faster
Next Steps #
- Stale Content / Cache Issues — When changes don’t appear
- API Connection Issues — Fix connection problems