lovablehtml logo - turn your SPA into a crawler-friendly websiteBLOGAPI 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

ParameterTypeDescription
domainrequiredstringDomain name (e.g., "your-app.com")
pathrequiredstringPage path to invalidate (e.g., "/pricing")
prewarmbooleanRe-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

ParameterTypeDescription
domainrequiredstringDomain name
pathsrequiredstring[]Array of paths to invalidate (min 1 item)
prewarmbooleanRe-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

ParameterTypeDescription
domainrequiredstringDomain name to purge completely
sitemapUrlstring (URL)Custom sitemap URL for prewarm path discovery. Falls back to the domain's stored sitemap if omitted.
prewarmbooleanRe-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

ParameterTypeDescription
domainrequiredstringDomain name (e.g., "your-app.com")
sitemapUrlstring (URL)Custom sitemap URL. Falls back to the domain's stored sitemap if omitted.
prewarmbooleanRe-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 our assistant anything
See our docs
Leave a message
Leave a message
We'll get back to you soon
Book a Meeting
Select a date & time
Avatar
Support Assistant
We typically reply instantly
Thinking
Preview
Powered by ReplyMaven
Avatar
Support Assistant
Hi, how can we help?