{"id":386035,"date":"2023-06-07T07:29:33","date_gmt":"2023-06-07T07:29:33","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=386035"},"modified":"2023-07-20T11:56:15","modified_gmt":"2023-07-20T11:56:15","slug":"how-to-use-redis-for-api-caching-in-opencart","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/","title":{"rendered":"How to use Redis for API caching in Opencart?"},"content":{"rendered":"\n<p>Before starting  the  use of  Redis caching for API in Opencart, you need to know about :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Redis Caching <\/li>\n\n\n\n<li>API <\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Redis Overview<\/h2>\n\n\n\n<p>Redis caching stands for&nbsp;<strong>Re<\/strong>mote&nbsp;<strong>Di<\/strong>ctionary&nbsp;<strong>S<\/strong>erver caching. It is an open-source, fast, in-memory, key-value data store. Mostly it is used for an application cache or quick response database.<\/p>\n\n\n\n<p>Redis is a key-value-based NoSQL database that stores data in memory, i.e. in RAM &nbsp;rather than storing it in a disk or SSD.<\/p>\n\n\n\n<p>Redis provides several types of data structures like &#8211; <em>strings, hashes, lists, sorted sets with range queries, sets, bitmaps, hyperloglogs, geospatial indexes, and streams.<\/em> &nbsp;<\/p>\n\n\n\n<p>You can explore more about <a href=\"https:\/\/webkul.com\/blog\/what-is-redis-its-capabilities-and-features\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Redis Caching and its features<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">API Overview<\/h2>\n\n\n\n<p>Nowadays most web applications are built upon APIs.&nbsp;An&nbsp;API, or application programming interface, helps two programs or applications to communicate with each other by providing them with sets of definitions, functions, and tools. <\/p>\n\n\n\n<p>It takes the request from the user and sends it to the service provider and then again sends the result generated from the service provider to the desired user. <\/p>\n\n\n\n<p>Generally,  we have used  REST API that communicates via HTTP requests to perform standard database functions like creating, reading, updating, and deleting records. <\/p>\n\n\n\n<p>There are four request methods that can be used in making API:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>GET <\/strong>\u2013 Gathers the data<\/li>\n\n\n\n<li><strong>PUT <\/strong>\u2013 Updates the data<\/li>\n\n\n\n<li><strong>POST<\/strong> \u2013 Creates the data<\/li>\n\n\n\n<li><strong>DELETE<\/strong> \u2013 Deletes the data<\/li>\n<\/ol>\n\n\n\n<p><strong>Note-<\/strong> You can check how to create a custom <a href=\"https:\/\/webkul.com\/blog\/use-opencarts-rest-api\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">REST API <\/a> in Opencart. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation of Redis Caching In Opencart APIs<\/h2>\n\n\n\n<p>While implementing of Redis caching, Either you can use the default Opencart API  or can create a custom one.<\/p>\n\n\n\n<p><strong>Step 1<\/strong>:  First install Redis to your server by referring to the blog link &#8211; <a href=\"https:\/\/webkul.com\/blog\/using-redis-cache-opencart\/#:~:text=According%20to%20its%20website%2C%20Redis,geospatial%20indexes%20with%20radius%20queries.\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Using Redis Cache In Opencart<\/a><\/p>\n\n\n\n<p><strong>Step 2: <\/strong> Navigate at path<em> <\/em>&#8220;system-&gt;library-&gt;cache-&gt;redis.php&#8221; at your project&#8217;s root directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Cache;\nclass Redis {\n    private $expire;\n    private $cache;\n\n    public function __construct($expire) {\n        $this-&gt;expire = $expire;\n\n        $this-&gt;cache = new \\Redis();\n        $this-&gt;cache-&gt;pconnect(CACHE_HOSTNAME, CACHE_PORT);\n    }\n\n    public function get($key) {\n        $data = $this-&gt;cache-&gt;get(CACHE_PREFIX . $key);\n        return json_decode($data, true);\n    }\n\n    public function set($key,$value) {\n        $status = $this-&gt;cache-&gt;set(CACHE_PREFIX . $key, json_encode($value));\n        if($status){\n            $this-&gt;cache-&gt;setTimeout(CACHE_PREFIX . $key, $this-&gt;expire);\n        }\n        return $status;\n    }\n\n    public function delete($key) {\n        $this-&gt;cache-&gt;delete(CACHE_PREFIX . $key);\n    }\n}<\/pre>\n\n\n\n<p>This file contains three methods :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>SetMethod <\/strong>&#8211;  SetMethod has two parameters one is $key and second is $value. With the use of this method,  redis caching can be set with the unique key at which you want to set the data. <\/li>\n\n\n\n<li><strong>GetMethod &#8211; <\/strong> GetMethod requires only the key at which you have set the data and returns the cached data.<\/li>\n\n\n\n<li><strong>DeleteMethod &#8211; <\/strong>With the use of this method,  set the key of the cached data that you want to delete.<\/li>\n<\/ol>\n\n\n\n<p><strong>Note <\/strong>&#8211; Additionally, you can also set the cache expiration time.<\/p>\n\n\n\n<p><strong>Step 3:<\/strong> Create an API in the directory &#8220;catalog\/controller\/api\/categories.php&#8221;. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n  * Webkul Software.\n  *\n  * @category Webkul\n  * @package Opencart Module Tutorial\n  * @author Webkul\n  * @license https:\/\/store.webkul.com\/license.html\n  *\/\nclass ControllerApiCategories extends Controller {\n\tpublic function getAllCategories(){\n\n\t\t$this-&gt;load-&gt;language(&#039;api\/category&#039;);\n        $post = $this-&gt;request-&gt;post;\n\t\t$json = array();\n\n\t\t\/\/Accepting data in json format \/ raw data\n\n\t\t$raw_data = json_decode(file_get_contents(&quot;php:\/\/input&quot;),true);\n\n\t\tif ($raw_data) {\n\t\t\tforeach ($raw_data as $key =&gt; $value) {\n\t\t\t\t$post&#091;$key] = $value;\n\t\t\t}\n\t\t}\n     \n\t\tif (!isset($this-&gt;session-&gt;data&#091;&#039;api_id&#039;])) {\n\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;warning&#039;] = $this-&gt;language-&gt;get(&#039;error_permission&#039;);\n\t\t\n\t\t} else {\n\n\t\t\tif(!isset($post&#091;&#039;category_id&#039;]) || !$data&#091;&#039;category_id&#039;])\n\t\t\t$post&#091;&#039;category_id&#039;] = 0;\n            \n\t\t\t\/\/ include redis api caching\n\t\t\t$json = $this-&gt;cache-&gt;get(&#039;categories&#039;);\n\t\t\t\n\t\t\tif (!$json) {\n\t\t\t\t$this-&gt;load-&gt;model(&#039;catalog\/category&#039;);\n\t\t\t\t$categories =  $this-&gt;model_catalog_category-&gt;getCategories($post&#091;&#039;category_id&#039;]);\n\n\t\t\t\tif ($categories) {\n\t\t\t\t\t$json = array(\n\t\t\t\t\t\t&#039;error&#039;\t=&gt; 0,\n\t\t\t\t\t\t&#039;category&#039; =&gt; $categories\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$json = array(\n\t\t\t\t\t\t&#039;error&#039; =&gt; 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t    \t$this-&gt;cache-&gt;set(&#039;categories&#039;, $json);\n\t\t    }\n\t\t$this-&gt;response-&gt;addHeader(&#039;Content-Type: application\/json&#039;);\n\t\t$this-&gt;response-&gt;setOutput(json_encode($json));\n\t}\n}<\/pre>\n\n\n\n<p>In the above code, we have set the key &#8216;categories&#8217; for storing the categories data as cached data.<\/p>\n\n\n\n<p><strong>Step 4:<\/strong> We\u2019ll need more entries inside our language to display errors. So create a language file inside the directory path &#8220;catalog\/language\/en-gb(or any)\/api\/category.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n  * Webkul Software.\n  *\n  * @category Webkul\n  * @package Opencart Module Tutorial\n  * @author Webkul\n  * @license https:\/\/store.webkul.com\/license.html\n  *\/\n\/\/ Error\n$_&#091;&#039;error_permission&#039;] = &#039;Warning: You do not have permission to access the API!&#039;;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Result of Using Redis Caching<\/h2>\n\n\n\n<p>for access Opencart API, set the URL endpoint by entering&nbsp;<strong>HTTP or https:\/\/&lt;opencart base-url&gt;index.php?route=api\/categories\/getAllCategories<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Before implementation &#8211; <\/h4>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"865\" height=\"515\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png\" alt=\"before-9\" class=\"wp-image-387918\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png 865w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9-300x179.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9-250x149.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9-768x457.png 768w\" sizes=\"(max-width: 865px) 100vw, 865px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">After Implementations &#8211; <\/h4>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"870\" height=\"523\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/after-3.png\" alt=\"after-3\" class=\"wp-image-387919\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/after-3.png 870w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/after-3-300x180.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/after-3-250x150.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/after-3-768x462.png 768w\" sizes=\"(max-width: 870px) 100vw, 870px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Here you can compare the timing of the data retrieval without using redis caching and after the use of redis caching.<\/p>\n\n\n\n<p>Thank You!<\/p>\n\n\n\n<p>If you need custom&nbsp;<a href=\"https:\/\/webkul.com\/opencart-development\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Opencart Development services<\/a>&nbsp;then feel free to&nbsp;<a href=\"https:\/\/webkul.com\/contacts\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">reach us<\/a>&nbsp;and also explore our exclusive range of&nbsp;<a href=\"https:\/\/store.webkul.com\/OpenCart-Modules.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Opencart Extensions<\/a>.<\/p>\n\n\n\n<p>!! Have a Great Day Ahead !!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before starting the use of Redis caching for API in Opencart, you need to know about : Redis Overview Redis caching stands for&nbsp;Remote&nbsp;Dictionary&nbsp;Server caching. It is an open-source, fast, in-memory, key-value data store. Mostly it is used for an application cache or quick response database. Redis is a key-value-based NoSQL database that stores data in <a href=\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":525,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[305],"tags":[2071,590],"class_list":["post-386035","post","type-post","status-publish","format-standard","hentry","category-opencart","tag-opencart","tag-webkul"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use Redis for API caching in Opencart? - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use Redis for API caching in Opencart? - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Before starting the use of Redis caching for API in Opencart, you need to know about : Redis Overview Redis caching stands for&nbsp;Remote&nbsp;Dictionary&nbsp;Server caching. It is an open-source, fast, in-memory, key-value data store. Mostly it is used for an application cache or quick response database. Redis is a key-value-based NoSQL database that stores data in [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-07T07:29:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-20T11:56:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png\" \/>\n<meta name=\"author\" content=\"Sandhya Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sandhya Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/\"},\"author\":{\"name\":\"Sandhya Mishra\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ea8e30ea11c5b2953191b79a4bcac159\"},\"headline\":\"How to use Redis for API caching in Opencart?\",\"datePublished\":\"2023-06-07T07:29:33+00:00\",\"dateModified\":\"2023-07-20T11:56:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/\"},\"wordCount\":555,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png\",\"keywords\":[\"opencart\",\"webkul\"],\"articleSection\":[\"opencart\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/\",\"name\":\"How to use Redis for API caching in Opencart? - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png\",\"datePublished\":\"2023-06-07T07:29:33+00:00\",\"dateModified\":\"2023-07-20T11:56:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png\",\"width\":865,\"height\":515,\"caption\":\"before-9\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use Redis for API caching in Opencart?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ea8e30ea11c5b2953191b79a4bcac159\",\"name\":\"Sandhya Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/70445b6b82958c3b345e220309c945da5f7cf1526b8d54cf8293d418a00bb370?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/70445b6b82958c3b345e220309c945da5f7cf1526b8d54cf8293d418a00bb370?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Sandhya Mishra\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/sandhya-oc722\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use Redis for API caching in Opencart? - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/","og_locale":"en_US","og_type":"article","og_title":"How to use Redis for API caching in Opencart? - Webkul Blog","og_description":"Before starting the use of Redis caching for API in Opencart, you need to know about : Redis Overview Redis caching stands for&nbsp;Remote&nbsp;Dictionary&nbsp;Server caching. It is an open-source, fast, in-memory, key-value data store. Mostly it is used for an application cache or quick response database. Redis is a key-value-based NoSQL database that stores data in [...]","og_url":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-06-07T07:29:33+00:00","article_modified_time":"2023-07-20T11:56:15+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png","type":"","width":"","height":""}],"author":"Sandhya Mishra","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Sandhya Mishra","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/"},"author":{"name":"Sandhya Mishra","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ea8e30ea11c5b2953191b79a4bcac159"},"headline":"How to use Redis for API caching in Opencart?","datePublished":"2023-06-07T07:29:33+00:00","dateModified":"2023-07-20T11:56:15+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/"},"wordCount":555,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png","keywords":["opencart","webkul"],"articleSection":["opencart"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/","url":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/","name":"How to use Redis for API caching in Opencart? - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png","datePublished":"2023-06-07T07:29:33+00:00","dateModified":"2023-07-20T11:56:15+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/before-9.png","width":865,"height":515,"caption":"before-9"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-for-api-caching-in-opencart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use Redis for API caching in Opencart?"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ea8e30ea11c5b2953191b79a4bcac159","name":"Sandhya Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/70445b6b82958c3b345e220309c945da5f7cf1526b8d54cf8293d418a00bb370?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/70445b6b82958c3b345e220309c945da5f7cf1526b8d54cf8293d418a00bb370?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Sandhya Mishra"},"url":"https:\/\/webkul.com\/blog\/author\/sandhya-oc722\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/386035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/525"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=386035"}],"version-history":[{"count":43,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/386035\/revisions"}],"predecessor-version":[{"id":388008,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/386035\/revisions\/388008"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=386035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=386035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=386035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}