For the complete documentation index, see llms.txt. This page is also available as Markdown.

Toggle website cache

Turns server-side caching for the website on or off, based on the enabled flag.

Toggle website cache

patch

Turns server-side caching for the website on or off, based on the enabled flag. Enable it for faster page loads, reduced server load, and improved user experience; recommended for production websites. Disabling may impact performance; to temporarily bypass caching while developing or debugging, prefer toggling cacheless mode instead.

Does nothing if caching is already in the requested state.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Body
enabledbooleanRequired

Turn server-side caching on (true) or off (false) for the website.

Example: true
Responses
200

Success empty response

application/json
messagestringOptionalExample: Request accepted
patch/api/hosting/v1/accounts/{username}/websites/{domain}/cache/toggle
PATCH /api/hosting/v1/accounts/{username}/websites/{domain}/cache/toggle HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "enabled": true
}
{
  "message": "Request accepted"
}

Last updated

Was this helpful?