Add Browser Cache TTL endpoint (#127)

Co-authored-by: bnalonezi <b.alenezi@zid.sa>
This commit is contained in:
bnalonezi
2020-07-07 13:18:40 +03:00
committed by GitHub
parent afd332a747
commit fab493d2d3
4 changed files with 83 additions and 0 deletions

View File

@@ -106,6 +106,37 @@ class ZoneSettings implements API
return false;
}
public function getBrowserCacheTtlSetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/browser_cache_ttl'
);
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result->value;
}
return false;
}
public function updateBrowserCacheTtlSetting($zoneID, $value)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/browser_cache_ttl',
[
'value' => $value
]
);
$body = json_decode($return->getBody());
if ($body->success) {
return true;
}
return false;
}
public function updateMinifySetting($zoneID, $html, $css, $javascript)
{
$return = $this->adapter->patch(