lovablehtml logo - turn your SPA into a crawler-friendly website BLOGAPI PLATFORMPRICING

Cache Invalidation

Purge cached prerendered pages and optionally prewarm them.

Purge cached prerendered pages for domains you own. Optionally prewarm to immediately re-render.

Invalidate Single Page

POST/api/prerender/cache/invalidate-page-cache

Invalidate 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

json
CopyDownload
{
"ok": true,
"deleted": 1,
"prewarmed": 1
}

Example

javascript
CopyDownload
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 }
bash
CopyDownload
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

POST/api/prerender/cache/invalidate-paths-cache

Invalidate 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

json
CopyDownload
{
"ok": true,
"deleted": 3,
"prewarmed": 3
}

Example

javascript
CopyDownload
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 }
bash
CopyDownload
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

POST/api/prerender/cache/invalidate-site-cache

Purge 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

json
CopyDownload
{
"ok": true,
"deleted": 42,
"queued": 12,
"pathSource": "sitemap",
"totalPaths": 12
}

Example

javascript
CopyDownload
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 }
bash
CopyDownload
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

POST/api/prerender/cache/invalidate-updated-paths

Invalidate 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

json
CopyDownload
{
"ok": true,
"deleted": 5,
"queued": 5,
"pathSource": "sitemap",
"totalPaths": 5
}

Example

javascript
CopyDownload
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 }
bash
CopyDownload
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}'
Avatar
How can we help?
Get instant answers to your questions or leave a message for an engineer will reach out
Ask AI about LovableHTML
See our docs
Contact support
Leave a message
We'll get back to you soon
Avatar
Ask AI about LovableHTML
Team is also here to help
Thinking
Preview
Powered by ReplyMaven
Avatar
Aki
Hi, how can we help?