Purge cached prerendered pages for domains you own. Optionally prewarm to immediately re-render.
Invalidate Single Page
/api/prerender/cache/invalidate-page-cacheInvalidate the cache for a single page path.
Request Body
| Parameter | Type | Description |
|---|---|---|
domainrequired | string | Domain name (e.g., "your-app.com") |
pathrequired | string | Page path to invalidate (e.g., "/pricing") |
prewarm | boolean | Re-render immediately after invalidation. Default: false |
Response Body
{"ok": true,"deleted": 1,"prewarmed": 1}
Example
const response = await fetch('https://lovablehtml.com/api/prerender/cache/invalidate-page-cache',{method: 'POST',headers: {'Content-Type': 'application/json','x-lovablehtml-api-key': '<API_KEY>'},body: JSON.stringify({domain: 'your-app.com',path: '/pricing',prewarm: true})});const result = await response.json();// { "ok": true, "deleted": 1, "prewarmed": 1 }
curl -X POST \"https://lovablehtml.com/api/prerender/cache/invalidate-page-cache" \-H "Content-Type: application/json" \-H "x-lovablehtml-api-key: <API_KEY>" \-d '{"domain":"your-app.com","path":"/pricing","prewarm":true}'
Invalidate Multiple Paths
/api/prerender/cache/invalidate-paths-cacheInvalidate cache for multiple page paths in a single request.
Request Body
| Parameter | Type | Description |
|---|---|---|
domainrequired | string | Domain name |
pathsrequired | string[] | Array of paths to invalidate (min 1 item) |
prewarm | boolean | Re-render all paths after invalidation. Default: false |
Response Body
{"ok": true,"deleted": 3,"prewarmed": 3}
Example
const response = await fetch('https://lovablehtml.com/api/prerender/cache/invalidate-paths-cache',{method: 'POST',headers: {'Content-Type': 'application/json','x-lovablehtml-api-key': '<API_KEY>'},body: JSON.stringify({domain: 'your-app.com',paths: ['/', '/pricing', '/blog/post'],prewarm: true})});const result = await response.json();// { "ok": true, "deleted": 3, "prewarmed": 3 }
curl -X POST \"https://lovablehtml.com/api/prerender/cache/invalidate-paths-cache" \-H "Content-Type: application/json" \-H "x-lovablehtml-api-key: <API_KEY>" \-d '{"domain":"your-app.com","paths":["/","/pricing","/blog/post"],"prewarm":true}'
Invalidate Entire Site
/api/prerender/cache/invalidate-site-cachePurge the entire cache for a domain. Optionally prewarm from sitemap. Use sparingly.
Request Body
| Parameter | Type | Description |
|---|---|---|
domainrequired | string | Domain name to purge completely |
sitemapUrl | string (URL) | Custom sitemap URL for prewarm path discovery. Falls back to the domain's stored sitemap if omitted. |
prewarm | boolean | Re-render all sitemap pages after invalidation. Default: false |
This will delete all cached pages for the domain. The next request to each page will trigger a fresh render.
Response Body
{"ok": true,"deleted": 42,"queued": 12,"pathSource": "sitemap","totalPaths": 12}
Example
const response = await fetch('https://lovablehtml.com/api/prerender/cache/invalidate-site-cache',{method: 'POST',headers: {'Content-Type': 'application/json','x-lovablehtml-api-key': '<API_KEY>'},body: JSON.stringify({domain: 'your-app.com',prewarm: true,sitemapUrl: 'https://your-app.com/sitemap.xml'})});const result = await response.json();// { "ok": true, "deleted": 42, "queued": 12, "pathSource": "sitemap", "totalPaths": 12 }
curl -X POST \"https://lovablehtml.com/api/prerender/cache/invalidate-site-cache" \-H "Content-Type: application/json" \-H "x-lovablehtml-api-key: <API_KEY>" \-d '{"domain":"your-app.com","prewarm":true}'
Invalidate Updated Paths
/api/prerender/cache/invalidate-updated-pathsInvalidate cache only for pages whose sitemap lastmod is newer than the cached snapshot. Useful for surgical cache refreshes after content updates.
Request Body
| Parameter | Type | Description |
|---|---|---|
domainrequired | string | Domain name (e.g., "your-app.com") |
sitemapUrl | string (URL) | Custom sitemap URL. Falls back to the domain's stored sitemap if omitted. |
prewarm | boolean | Re-render updated paths after invalidation. Default: false |
A path is considered "updated" if its sitemap <lastmod> date is more recent than the cached snapshot's creation time, or if the path has never been cached. Paths without a <lastmod> entry are always included.
Response Body
{"ok": true,"deleted": 5,"queued": 5,"pathSource": "sitemap","totalPaths": 5}
Example
const response = await fetch('https://lovablehtml.com/api/prerender/cache/invalidate-updated-paths',{method: 'POST',headers: {'Content-Type': 'application/json','x-lovablehtml-api-key': '<API_KEY>'},body: JSON.stringify({domain: 'your-app.com',prewarm: true,sitemapUrl: 'https://your-app.com/sitemap.xml'})});const result = await response.json();// { "ok": true, "deleted": 5, "queued": 5, "pathSource": "sitemap", "totalPaths": 5 }
curl -X POST \"https://lovablehtml.com/api/prerender/cache/invalidate-updated-paths" \-H "Content-Type: application/json" \-H "x-lovablehtml-api-key: <API_KEY>" \-d '{"domain":"your-app.com","prewarm":true}'
