File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,38 @@ public function changeDevelopmentMode(string $zoneID, bool $enable = false): boo
153153 return false ;
154154 }
155155
156+ /**
157+ * Return caching level settings
158+ * @param string $zoneID
159+ * @return string
160+ */
161+ public function getCachingLevel (string $ zoneID ): string
162+ {
163+ $ response = $ this ->adapter ->get ('zones/ ' . $ zoneID . '/settings/cache_level ' );
164+
165+ $ this ->body = json_decode ($ response ->getBody ());
166+
167+ return $ this ->body ->result ->value ;
168+ }
169+
170+ /**
171+ * Change caching level settings
172+ * @param string $zoneID
173+ * @param string $level (aggressive | basic | simplified)
174+ * @return bool
175+ */
176+ public function setCachingLevel (string $ zoneID , string $ level = 'aggressive ' ): bool
177+ {
178+ $ response = $ this ->adapter ->patch ('zones/ ' . $ zoneID . '/settings/cache_level ' , ['value ' => $ level ]);
179+
180+ $ this ->body = json_decode ($ response ->getBody ());
181+
182+ if ($ this ->body ->success ) {
183+ return true ;
184+ }
185+
186+ return false ;
187+ }
156188
157189 /**
158190 * Purge Everything
You can’t perform that action at this time.
0 commit comments