Toggle website cache
Turns server-side caching for the website on or off, based on the enabled flag.
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:
u123456789domainstringRequiredExample:
Domain name
mydomain.tldBody
enabledbooleanRequiredExample:
Turn server-side caching on (true) or off (false) for the website.
trueResponses
200
Success empty response
application/json
messagestringOptionalExample:
Request accepted401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
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?