Documentation → Administrator Guides
Cache Management
How Developer Sitemap caching works and how to manage it.
How Caching Works
Developer Sitemap uses the WordPress Transients API to cache generated sitemaps. This improves performance by avoiding repeated database queries and XML generation on every request.
Cache Flow
- Request arrives for
/sitemap.xml - Plugin checks for cached version in transients
- If found and not expired, cached XML is served
- If not found or expired, sitemap is regenerated
- New sitemap is cached for future requests
Cache Keys
Each sitemap type has its own cache key:
| Sitemap | Cache Key |
|---|---|
| Index | developer_sitemap_index |
| Posts | developer_sitemap_post |
| Pages | developer_sitemap_page |
| Products | developer_sitemap_product |
| Taxonomies | developer_sitemap_taxonomy |
| Authors | developer_sitemap_author |
Cache Settings
Configure caching in Sitemap → Settings under Cache Settings.
| Setting | Default | Description |
|---|---|---|
| Enable Cache | On | Toggle caching on/off |
| Cache Duration | 3600 sec | How long to cache (1 hour) |
| GZIP Compression | Off | Compress cached output |
Cache Duration Guidelines
| Site Type | Duration | Seconds |
|---|---|---|
| News/high-frequency | 30 minutes | 1800 |
| Active blog | 1 hour | 3600 |
| Business site | 2-4 hours | 7200-14400 |
| Static/portfolio | 24 hours | 86400 |
Automatic Invalidation
The cache automatically clears when content changes:
| Action | Cache Cleared |
|---|---|
| Post/page published | Relevant sitemap + index |
| Post/page updated | Relevant sitemap + index |
| Post/page deleted | Relevant sitemap + index |
| Product published/updated | Product sitemap + index |
| Settings changed | All sitemaps |
Manual Regeneration
To manually clear and regenerate all sitemaps:
- Go to Sitemap → Dashboard
- Click Regenerate Sitemap
- Wait for confirmation message
Object Cache Compatibility
Developer Sitemap works with persistent object caches like Redis or Memcached. When an object cache is configured, transients are stored there instead of the database, providing even faster performance.
Compatible Object Caches
- Redis (via Redis Object Cache plugin)
- Memcached
- WP Object Cache
Tip: If you use a persistent object cache, sitemap caching becomes even more efficient since transients are served from memory.
