{"id":26338,"date":"2024-09-12T18:49:47","date_gmt":"2024-09-12T18:49:47","guid":{"rendered":"https:\/\/www.s-sols.com\/?post_type=doc&#038;p=26338"},"modified":"2024-09-12T18:49:47","modified_gmt":"2024-09-12T18:49:47","slug":"api-accel","status":"publish","type":"doc","link":"https:\/\/www.s-sols.com\/docs\/wordpress\/accelerator\/api-accel","title":{"rendered":"API Accelerator for WordPress"},"content":{"rendered":"<p>\n  There is API functions that help to automate managing cache.\n<\/p>\n<h2>\n  Functions<br \/>\n<\/h2>\n<p><a id=\"OperateCache\"><\/a><strong>Available functions:<\/strong>\n<\/p>\n<ul>\n<li><a href=\"#OperateCache\"><strong>OperateCache<\/strong><\/a>\n  <\/li>\n<li><a href=\"#GetCacheStatus\"><strong>GetCacheStatus<\/strong><\/a>\n  <\/li>\n<\/ul>\n<h3>\n  OperateCache<br \/>\n<\/h3>\n<p>\n  Manages cache (all pages or particular object).\n<\/p>\n<h4><a id=\"GetCacheStatus\"><\/a>Syntax<br \/>\n<\/h4>\n<p style=\"text-align:justify\"><code class=\"p\">OperateCache( $op = API::CACHE_OP_DEL, $obj = null )<\/code>\n<\/p>\n<h4>\n  Arguments<br \/>\n<\/h4>\n<ul>\n<li><strong>$op<\/strong>\n<p style=\"text-align:left\">\n      Values:\n    <\/p>\n<ul>\n<li><strong>CACHE_OP_REVALIDATE<\/strong>\n<p style=\"text-align:left\"><a href=\".\/status-and-operations-accel#operate_revalidate\">Revalidate<\/a> cache.\n        <\/p>\n<\/li>\n<li><strong>CACHE_OP_CHECK_REVALIDATE<\/strong>\n<p style=\"text-align:left\"><a href=\".\/status-and-operations-accel#operate_checkrevalidate\">Revalidate<\/a> cache if needed.\n        <\/p>\n<\/li>\n<li><strong>CACHE_OP_CLEAR<\/strong>\n<p style=\"text-align:left\"><a href=\".\/status-and-operations-accel#operate_cleanup\">Cleanup<\/a> old.\n        <\/p>\n<\/li>\n<li><strong>CACHE_OP_DEL<\/strong>\n<p style=\"text-align:left\"><a href=\".\/status-and-operations-accel#operate_empty\">Delete<\/a> cache.\n        <\/p>\n<\/li>\n<li><strong>CACHE_OP_SRVDEL<\/strong>\n<p style=\"text-align:left\"><a href=\".\/status-and-operations-accel#operate_srvclr\">Delete<\/a> server&#8217;s cache (if available).\n        <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>$obj<\/strong>\n<p style=\"text-align:left\">\n      Site&#8217;s URLs or relative URIs each on new line or leave empty for site&#8217;s root. Also, <a href=\".\/settings-revalidation-expressions-accel\">revalidation expressions<\/a> can be also used.\n    <\/p>\n<\/li>\n<\/ul>\n<h4>\n  Example<br \/>\n<\/h4>\n<p style=\"text-align:justify\"><code class=\"p\">\\seraph_accel\\API::OperateCache( \\seraph_accel\\API::CACHE_OP_DEL, '\/mypage\/' );<\/code>\n<\/p>\n<h3>\n  GetCacheStatus<br \/>\n<\/h3>\n<p>\n  Gets information about cache object by URL.\n<\/p>\n<h4>\n  Syntax<br \/>\n<\/h4>\n<p style=\"text-align:justify\"><code class=\"p\">GetCacheStatus( $obj, $headers = array() )<\/code>\n<\/p>\n<h4>\n  Arguments<br \/>\n<\/h4>\n<ul start=\"3\">\n<li><strong>$obj<\/strong>\n<p style=\"text-align:left\">\n      URL for checking.\n    <\/p>\n<\/li>\n<li><strong>$headers<\/strong>\n<p style=\"text-align:left\">\n      Optional array of HTTP headers. E,g, \u2018User-Agent\u2019 can be specified to check mobile page cache (see the sample below).\n    <\/p>\n<\/li>\n<\/ul>\n<h4>\n  Return value<br \/>\n<\/h4>\n<p>\n  Array with properties:\n<\/p>\n<ul start=\"5\">\n<li><strong>cache<\/strong>\n<p style=\"text-align:left\">\n      Values:\n    <\/p>\n<ul>\n<li><strong>true<\/strong>\n<p style=\"text-align:left\">\n          Object cached.\n        <\/p>\n<\/li>\n<li><strong>false<\/strong>\n<p style=\"text-align:left\">\n          Object not cached.\n        <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>optimization<\/strong>\n<p style=\"text-align:left\">\n      Values:\n    <\/p>\n<ul>\n<li><strong>true<\/strong>\n<p style=\"text-align:left\">\n          Object is fully optimized.\n        <\/p>\n<\/li>\n<li><strong>false<\/strong>\n<p style=\"text-align:left\">\n          Object is not fully optimized (cache only).\n        <\/p>\n<\/li>\n<li><strong>null<\/strong>\n<p style=\"text-align:left\">\n          Object not cached.\n        <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>status<\/strong>\n<p style=\"text-align:left\">\n      Values:\n    <\/p>\n<ul>\n<li><strong>&#8216;done&#8217;<\/strong>\n<p style=\"text-align:left\">\n          Processing completed.\n        <\/p>\n<\/li>\n<li><strong>&#8216;revalidating&#8217;<\/strong>\n<p style=\"text-align:left\">\n          Processing is in progress.\n        <\/p>\n<\/li>\n<li><strong>&#8216;pending&#8217;<\/strong>\n<p style=\"text-align:left\">\n          Processing is in waiting state to be processed.\n        <\/p>\n<\/li>\n<li><strong>&#8216;none&#8217;<\/strong>\n<p style=\"text-align:left\">\n          Processing has not been performed.\n        <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>dscFile<\/strong>\n<p style=\"text-align:left\">\n      Relative path of cache object descriptor file.\n    <\/p>\n<\/li>\n<\/ul>\n<h4>\n  Example<br \/>\n<\/h4>\n<p><code class=\"p\">\\seraph_accel\\API::GetCacheStatus( 'https:\/\/mysite\/mypage\/', array( 'User-Agent' =&gt; 'AppleWebKit\/9999999.99 Mobile' ) );<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is API functions that help to automate managing cache. Functions Available functions: OperateCache GetCacheStatus OperateCache Manages cache (all pages or particular object). Syntax OperateCache( $op = API::CACHE_OP_DEL, $obj = null ) Arguments $op Values: CACHE_OP_REVALIDATE Revalidate cache. CACHE_OP_CHECK_REVALIDATE Revalidate cache if needed. CACHE_OP_CLEAR Cleanup old. CACHE_OP_DEL Delete cache. CACHE_OP_SRVDEL Delete server&#8217;s cache (if available)&#8230;.<\/p>\n","protected":false},"author":18,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"rank_math_lock_modified_date":false},"categories":[816],"tags":[],"class_list":["post-26338","doc","type-doc","status-publish","hentry","category-accelerator"],"_links":{"self":[{"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/doc\/26338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/comments?post=26338"}],"wp:attachment":[{"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/media?parent=26338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/categories?post=26338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/tags?post=26338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}