Clearing the sitemap
Your sitemap is cached forever. Well, until you clear it that is, or your ttl is set to an actual interval (check the config for more).
To clear the cache, you can do one of three things:
update Sitemapamic’s configuration
change content via the CP
have an entry change its state
run a
pleasecommand
Events that trigger a clear
Sitemapamic listens for a number of Statamic events to clear its cache:
Statamic\Events\CollectionDeletedStatamic\Events\CollectionSavedStatamic\Events\CollectionTreeDeletedStatamic\Events\CollectionTreeEntriesMovedOrRemovedStatamic\Events\CollectionTreeSavedStatamic\Events\EntryDeletedStatamic\Events\EntrySavedStatamic\Events\EntryScheduleReachedStatamic\Events\LocalizedTermDeletedStatamic\Events\LocalizedTermSavedStatamic\Events\SiteCreatedStatamic\Events\SiteDeletedStatamic\Events\SiteSavedStatamic\Events\TaxonomyDeletedStatamic\Events\TaxonomySavedStatamic\Events\TermDeletedStatamic\Events\TermReferencesUpdatedStatamic\Events\TermSaved
Additionally, if you use our Scheduled Cache Invalidator addon:
MityDigital\StatamicScheduledCacheInvalidator\Events\ScheduledCacheInvalidated
Clear the entire cache
You can force the entire cache to clear by running:
1php please sitemapamic:clear
This could be a good command to have as part of your deployment script.
Clear the cache of a specific site
You can force the cache of a specific site to be cleared by providing the site param to the command:
1php please sitemapamic:clear --site=fr
This would clear the fr site from the cache.