cache
Kinsta caches a site in three places: the site cache of the environment itself, the edge cache and the CDN. The cache commands clear each of them and control edge caching and CDN image optimization.
kinstactl cache clear my-site --env livekinstactl cache edge clear my-site --env livekinstactl cache cdn clear my-site --env liveClearing a cache is not destructive, so none of these commands asks for confirmation. They wait for Kinsta to finish by default, and accept --no-wait, --timeout <minutes> and --dry-run; see operations.
cache clear
Section titled “cache clear”Clear the site cache of an environment.
kinstactl cache clear my-site --env livekinstactl cache clear [site] [options]Clear the site cache of an environment
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--dry-run | print the resolved target and request; change nothing |
--no-wait | return the operation ID instead of waiting |
--timeout <minutes> | give up waiting after this many minutes (default 30) |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: POST /sites/tools/clear-cache
Use this after a deploy or a content import, when a page still shows old content. It clears the site cache of that one environment, not the edge cache or the CDN.
cache edge clear
Section titled “cache edge clear”Clear the edge cache of an environment.
kinstactl cache edge clear my-site --env live --url https://example.com/blog/ --subdirectorieskinstactl cache edge clear [site] [options]Clear the edge cache of an environment
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--url <url> | clear only this URL |
--subdirectories | also clear the subdirectories of --url |
--dry-run | print the resolved target and request; change nothing |
--no-wait | return the operation ID instead of waiting |
--timeout <minutes> | give up waiting after this many minutes (default 30) |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: POST /sites/edge-caching/clear
Without --url, the whole edge cache of the environment is cleared. With --url only that URL is cleared, and --subdirectories extends that to everything below it.
cache edge enable
Section titled “cache edge enable”Enable edge caching of an environment.
kinstactl cache edge enable my-site --env livekinstactl cache edge enable [site] [options]Enable edge caching of an environment
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--dry-run | print the resolved target and request; change nothing |
--no-wait | return the operation ID instead of waiting |
--timeout <minutes> | give up waiting after this many minutes (default 30) |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: GET /sites, PUT /sites/edge-caching/status
Edge caching is a setting per environment. Use this command and cache edge disable to switch it, for example to turn it off while you debug a caching problem and on again afterwards.
cache edge disable
Section titled “cache edge disable”Disable edge caching of an environment.
kinstactl cache edge disable my-site --env livekinstactl cache edge disable [site] [options]Disable edge caching of an environment
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--dry-run | print the resolved target and request; change nothing |
--no-wait | return the operation ID instead of waiting |
--timeout <minutes> | give up waiting after this many minutes (default 30) |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: GET /sites, PUT /sites/edge-caching/status
The counterpart of cache edge enable.
cache cdn clear
Section titled “cache cdn clear”Clear the CDN cache of an environment.
kinstactl cache cdn clear my-site --env livekinstactl cache cdn clear [site] [options]Clear the CDN cache of an environment
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--dry-run | print the resolved target and request; change nothing |
--no-wait | return the operation ID instead of waiting |
--timeout <minutes> | give up waiting after this many minutes (default 30) |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: GET /sites/{site_id}/environments, POST /sites/cdn/clear-cache
Use this when static files such as images, CSS or JavaScript are served stale from the CDN.
cache cdn image-optimization
Section titled “cache cdn image-optimization”Show or set the CDN image optimization of an environment.
kinstactl cache cdn image-optimization my-site lossy --env livekinstactl cache cdn image-optimization <site> [type] [options]Show or set the CDN image optimization of an environment
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
type | set this type; omit to show the current one Choices: off, lossy, lossless. |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--dry-run | print the resolved target and request; change nothing |
--no-wait | return the operation ID instead of waiting |
--timeout <minutes> | give up waiting after this many minutes (default 30) |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: GET /sites, GET /sites/{site_id}/environments, PUT /sites/cdn/image-optimization
Without a type, the command shows the current setting. With off, lossy or lossless it changes the setting; only that form is an operation that waits and accepts --dry-run. To read the current value:
kinstactl cache cdn image-optimization my-site --env live