CWA 2 is a prerelease (2.0.0-alpha), heading for a beta. It runs production sites; configuration can still change between releases, always with upgrade notes. View versions and support
Cwa Api

cwa.siteConfig

Site-wide settings persisted in the API and cached in the Pinia store.

Site-wide settings persisted in the API and cached in the Pinia store.

cwa.siteConfig.config           // SiteConfigParams — reactive, read properties directly (no .value)
cwa.siteConfig.savedSiteConfig  // the server-persisted config (before any unsaved changes)
cwa.siteConfig.isLoading        // boolean

// Load or refresh from the API
await cwa.siteConfig.loadConfig()

// Save changed keys
cwa.siteConfig.saveConfig({
    siteName: 'My New Site Name',
    indexable: false
})

// Drop every cached page (POST /_/rendered_html/purge, admin only)
await cwa.siteConfig.purgePageCache()

// Drop everything cached: API responses and pages (POST /_/http_cache/purge, admin only)
// Rejects with a 501 if the deployment's cache can't be flushed
await cwa.siteConfig.purgeHttpCache()

// Purge only some tags: the same endpoint with a body never flushes
await cwa.siteConfig.purgeHttpCache({ paths: ['/about-us'], tags: ['/_api/component/titles/0199…'] })

// Load every public page into the cache, reporting progress (admin only)
const summary = await cwa.siteConfig.warmPageCache(({ completed, total }) => {
    console.log(`${completed} of ${total}`)
})
// summary: { total, warmed, failed: [{ path, status, error? }] }

The Purge page cache, Purge all cached data and Warm page cache buttons in site settings call these methods, and Purge this page's cache in a page's settings calls purgeHttpCache() with a body (see Purging One Page). The body takes paths, tags or both. See Page Caching for how the warm works, and Purging all cached data for when to use the full purge.

Saving

Only keys whose value differs from savedSiteConfig are sent, one request per key — POST /_/site_config_parameters for a key that has never been set, PATCH /_/site_config_parameters/{key} otherwise. saveConfig returns { totalConfigsChanged } straight away. It does not wait for the requests to finish; cwa.siteConfig.totalRequests.value drops back to 0 when they have.

saveConfig no-ops (returning totalConfigsChanged: 0) if a previous save is still in flight or the config hasn't been loaded yet. A sitemapXml value is validated as XML before anything is sent — an invalid document aborts the whole save.

Config Keys

The keys, their types and defaults are listed in Site Config & SEO › Default Settings. Passing any other key to saveConfig() sends an unknown parameter to the API.