{"id":394340,"date":"2023-08-14T05:21:33","date_gmt":"2023-08-14T05:21:33","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=394340"},"modified":"2025-04-29T11:18:53","modified_gmt":"2025-04-29T11:18:53","slug":"how-to-use-redis-api-caching-in-woocommerce-plugin","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/","title":{"rendered":"How to Use Redis for API Caching in WooCommerce Plugin"},"content":{"rendered":"\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Introduction<\/h2>\n<\/div><\/div>\n\n\n\n<p>Continuing our previous articles <a href=\"https:\/\/webkul.com\/blog\/caching-in-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">Caching in WordPress<\/a> and <a href=\"https:\/\/webkul.com\/blog\/how-to-use-caching-in-woocommerce-addons\/\" target=\"_blank\" rel=\"noreferrer noopener\">Caching in WooCommerce Addons<\/a> we&#8217;ll explore one more important caching i.e. Redis API Caching in WooCommerce. <\/p>\n\n\n\n<p>To implement this caching we&#8217;ll take the help of one famous PHP Library i.e. PHPfastecache.<\/p>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Installation<\/h2>\n<\/div><\/div>\n\n\n\n<p>To implement the Redis caching, please install and configure the Redis server on your system by following the <a href=\"https:\/\/redis.io\/docs\/getting-started\/installation\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">official Redis installation documentation<\/a>.<\/p>\n\n\n\n<p>To verify if the Redis server is installed and running you can open the terminal and execute the command as <em><strong>&#8216;redis-cli&#8217;<\/strong><\/em> If the Redis server is configured correctly, you will enter the Command Line Interface of the Redis server. <\/p>\n\n\n\n<p>Further, you hit the command <strong>`<code><em>ping`<\/em><\/code><\/strong><code> you will get the response as<\/code><em><strong>`PONG`<\/strong><\/em><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img decoding=\"async\" width=\"383\" height=\"153\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png\" alt=\"redis-cli-ping\" class=\"wp-image-394800 size-full\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png 383w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping-300x120.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping-250x100.png 250w\" sizes=\"(max-width: 383px) 100vw, 383px\" loading=\"lazy\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"644\" height=\"230\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping-keys.png\" alt=\"redis-cli-ping-keys\" class=\"wp-image-394802\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping-keys.png 644w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping-keys-300x107.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping-keys-250x89.png 250w\" sizes=\"(max-width: 644px) 100vw, 644px\" loading=\"lazy\" \/><\/figure>\n<\/div><\/div>\n\n\n\n<p>You can also see all the keys stored in the Redis server cache. Use the command <strong><em>`KEYS *`<\/em><\/strong><\/p>\n\n\n\n<p>To make the Redis server available globally to PHP, you just need to add the redis.so shared library to the extension list of the configuration file of your PHP server. <\/p>\n\n\n\n<p>In my case, I have added the php.ini file of the Apache server. Restart of Apache server.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1026\" height=\"806\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-so-php-ini.png\" alt=\"redis-so-php-ini\" class=\"wp-image-394811\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-so-php-ini.png 1026w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-so-php-ini-300x236.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-so-php-ini-250x196.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-so-php-ini-768x603.png 768w\" sizes=\"(max-width: 1026px) 100vw, 1026px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Verify Redis Extension<\/h2>\n<\/div><\/div>\n\n\n\n<p>To verify if the Redis extension is enabled, create a PHP file in the PHP installation folder and add the content as <strong><em>&lt;?php phpinfo();?><\/em><\/strong> Now open this file on the browser. <\/p>\n\n\n\n<p>If the Redis server is available it will be displayed something like the below screenshot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"994\" height=\"934\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/phpinfo.png\" alt=\"phpinfo\" class=\"wp-image-394830\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/phpinfo.png 994w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/phpinfo-300x282.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/phpinfo-250x235.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/phpinfo-768x722.png 768w\" sizes=\"(max-width: 994px) 100vw, 994px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Installing PHPfastecache<\/h2>\n<\/div><\/div>\n\n\n\n<p>Now to implement Redis caching in the <a href=\"https:\/\/store.webkul.com\/woocommerce-plugins\/WordPress.html\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress module<\/a> (plugin or theme) we need to install PHPfastcache inside the module. For this add a composer.json file and add the below lines.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">{\n    &quot;require&quot;: {\n        &quot;phpfastcache\/phpfastcache&quot;: &quot;^8.1&quot;\n    }\n}<\/pre>\n\n\n\n<p>Now run the command <code><em><strong>composer install<\/strong><\/em><\/code> from the root folder. It will install the complete PHPfastcache library and other dependencies inside a new <code><em><strong>vendor<\/strong><\/em><\/code> folder.<\/p>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Implementation<\/h2>\n<\/div><\/div>\n\n\n\n<p>To implement the Redis caching in the <a href=\"https:\/\/store.webkul.com\/woocommerce-plugins.html\" target=\"_blank\" rel=\"noreferrer noopener\">WooCommerce plugins<\/a>, we have created a class <strong><em>`<code>WK_Caching_PHPFastCache<\/code>`<\/em><\/strong> and add set methods as below. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">         \/**\n\t\t * Set the PHP fast cache contents by key and group.\n\t\t *\n\t\t * @param string $cache_key Cache key.\n\t\t * @param mixed  $cache_value Cache value.\n\t\t * @param string $cache_group Cache group.\n\t\t * @param int    $expiry Default 1 hour.\n\t\t *\/\n\t\tpublic function set( $cache_key, $cache_value, $cache_group = &#039;wk&#039;, $expiry = 3600 ) {\n\t\t\t$fast_key = &#039;_wkwc_cache_&#039; . $cache_group . &#039;_&#039; . $cache_key;\n\n\t\t\t$driver = $this-&gt;get_driver();\n\n\t\t\tif ( is_null( $this-&gt;psr_16_adapter ) ) {\n\t\t\t\t$this-&gt;psr_16_adapter = new Psr16Adapter( $driver );\n\t\t\t}\n\n\t\t\t$this-&gt;psr_16_adapter-&gt;set( $fast_key, $cache_value, $expiry );\n\t\t}\n\n\t\t\/**\n\t\t * Get the driver viz. Files, Redis, Predis, Mongodb -&gt; https:\/\/www.phpfastcache.com\/\n\t\t *\n\t\t * @return bool\n\t\t *\/\n\t\tprotected function get_driver() {\n\t\t\t$driver = &#039;Files&#039;;\n\n\t\t\t$res = exec( &#039;redis-cli ping&#039; );\n\n\t\t\tif ( &#039;PONG&#039; === $res ) {\n\t\t\t\t$driver = &#039;Redis&#039;;\n\t\t\t}\n\n\t\t\treturn apply_filters( &#039;_wkwc_get_fast_cache_driver&#039;, $driver );\n\t\t}<\/pre>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Code Explanation<\/h2>\n<\/div><\/div>\n\n\n\n<p>To set data in the cache we created a method <strong><em>`set`<\/em><\/strong> that accepts 4 parameters as cache key, value to cache, cache group, and the expiry time.  Based on supplied cache key and cache group we created a unique cache key with some default prefix.<\/p>\n\n\n\n<p>Next, we create an object of the Adapter class from the PHPfastcache library. This adapter requires the driver&#8217;s name. The PHPfastecache library supports multiple drivers like <strong><em>&#8216;Files&#8217;<\/em><\/strong>, <strong><em>&#8216;Redis&#8217;<\/em><\/strong>, <strong><em>&#8216;Predis&#8217;<\/em><\/strong>, <strong><em>&#8216;MongoDB&#8217;<\/em><\/strong> etc. <\/p>\n\n\n\n<p>In our scenario, we set up the Redis server and extension so after checking if the Redis server is running we supplied the &#8216;Redis&#8217; driver otherwise &#8216;Files&#8217; driver. <\/p>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Retrieving the data<\/h2>\n<\/div><\/div>\n\n\n\n<p>To get the stored data on the Redis cache server, we created a method  <strong><em>&#8216;get&#8217;<\/em><\/strong> as below.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">       \/**\n\t\t * Get the php fast cache contents by the key &amp; group.\n\t\t *\n\t\t * @param string $cache_key Cache key.\n\t\t * @param string $cache_group Cache Group.\n\t\t *\n\t\t * @return bool|mixed\n\t\t *\/\n\t\tpublic function get( $cache_key, $cache_group = &#039;wk&#039; ) {\n\t\t\t$fast_key = &#039;_wkwc_cache_&#039; . $cache_group . &#039;_&#039; . $cache_key;\n\n\t\t\t$driver = $this-&gt;get_driver();\n\n\t\t\tif ( is_null( $this-&gt;psr_16_adapter ) ) {\n\t\t\t\t$this-&gt;psr_16_adapter = new Psr16Adapter( $driver );\n\t\t\t}\n\n\t\t\tWK_Caching::log( &quot;Get PHP Fast Cache, Driver: $driver key: $fast_key, cache key: $cache_key, Cache group: $cache_group&quot; );\n\n\t\t\t$data = $this-&gt;psr_16_adapter-&gt;get( $fast_key );\n\n\t\t\treturn empty( $data ) ? false : $data;\n\t\t}<\/pre>\n\n\n\n<p>In the above code, we passed two parameters to our get method viz. <strong><em>&#8216;$cache_key&#8217;<\/em><\/strong> &amp; <strong><em>&#8216;$cache_group&#8217;<\/em><\/strong>  based on these params we again created the same unique key using the same prefix in the set method. And called the get method of the Adapter class. <\/p>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Conclusion: Redis for API caching in WooCommerce Add-ons<\/h2>\n<\/div><\/div>\n\n\n\n<p>For this article, we are concluding that Redis caching API is an efficient server caching method to provide faster results. We can implement this method for caching data to provide it on any API endpoint. <\/p>\n\n\n\n<p>We have successfully implemented the Redis caching API for our <a href=\"https:\/\/store.webkul.com\/woocommerce-multivendor-marketplace.html\" target=\"_blank\" rel=\"noreferrer noopener\">Multi-Vendor Marketplace for WooCommerce<\/a> plugin and implementing the same in our all WooCommerce extensions with their next releases.<\/p>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h2 class=\"wp-block-heading index-title\">Support<\/h2>\n<\/div><\/div>\n\n\n\n<p>For any technical assistance, please&nbsp;<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\">raise a ticket<\/a>&nbsp;or reach us by mail at&nbsp;support@webkul.com<\/p>\n\n\n\n<p>Also, you may <a href=\"https:\/\/webkul.com\/hire-woocommerce-developers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Hire WooCommerce Developers<\/a> for your custom project development.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Explaining installation and configuration of Redis caching in WooCommerce extensions.<\/p>\n","protected":false},"author":498,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13710,7966,1260],"tags":[3355,1316,5282],"class_list":["post-394340","post","type-post","status-publish","format-standard","hentry","category-caching","category-wordpress-woocommerce","category-wordpress","tag-caching","tag-redis","tag-redis-cache"],"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 WooCommerce Plugin - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Showing installation and Implementation of Redis caching server with the help of PHPfastecache library in woocommerce addons.\" \/>\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-api-caching-in-woocommerce-plugin\/\" \/>\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 WooCommerce Plugin - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Showing installation and Implementation of Redis caching server with the help of PHPfastecache library in woocommerce addons.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/\" \/>\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-08-14T05:21:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-29T11:18:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png\" \/>\n<meta name=\"author\" content=\"Dinesh Yadav\" \/>\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=\"Dinesh Yadav\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 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-api-caching-in-woocommerce-plugin\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/\"},\"author\":{\"name\":\"Dinesh Yadav\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/a2c513ba357ca0781d2ea37d9da0f076\"},\"headline\":\"How to Use Redis for API Caching in WooCommerce Plugin\",\"datePublished\":\"2023-08-14T05:21:33+00:00\",\"dateModified\":\"2025-04-29T11:18:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/\"},\"wordCount\":589,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png\",\"keywords\":[\"caching\",\"redis\",\"redis cache\"],\"articleSection\":[\"Caching\",\"WooCommerce\",\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/\",\"name\":\"How to Use Redis for API Caching in WooCommerce Plugin - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png\",\"datePublished\":\"2023-08-14T05:21:33+00:00\",\"dateModified\":\"2025-04-29T11:18:53+00:00\",\"description\":\"Showing installation and Implementation of Redis caching server with the help of PHPfastecache library in woocommerce addons.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png\",\"width\":383,\"height\":153,\"caption\":\"redis-cli-ping\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#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 WooCommerce Plugin\"}]},{\"@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\/a2c513ba357ca0781d2ea37d9da0f076\",\"name\":\"Dinesh Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/deaa9c46b9b57fbb117ac9a9e51ff5835f9320bd26661dd55bb9a162fc24d905?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/deaa9c46b9b57fbb117ac9a9e51ff5835f9320bd26661dd55bb9a162fc24d905?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Dinesh Yadav\"},\"description\":\"Dinesh Yadav, a seasoned Technical Project Manager in the WordPress department, excels in Marketplace Development Services. With deep expertise in WooCommerce modules. He crafts tailored solutions, optimizing performance and ensuring seamless user experiences for complex, scalable online marketplaces.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/dineshyadav-wp\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Redis for API Caching in WooCommerce Plugin - Webkul Blog","description":"Showing installation and Implementation of Redis caching server with the help of PHPfastecache library in woocommerce addons.","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-api-caching-in-woocommerce-plugin\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Redis for API Caching in WooCommerce Plugin - Webkul Blog","og_description":"Showing installation and Implementation of Redis caching server with the help of PHPfastecache library in woocommerce addons.","og_url":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-08-14T05:21:33+00:00","article_modified_time":"2025-04-29T11:18:53+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png","type":"","width":"","height":""}],"author":"Dinesh Yadav","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Dinesh Yadav","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/"},"author":{"name":"Dinesh Yadav","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/a2c513ba357ca0781d2ea37d9da0f076"},"headline":"How to Use Redis for API Caching in WooCommerce Plugin","datePublished":"2023-08-14T05:21:33+00:00","dateModified":"2025-04-29T11:18:53+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/"},"wordCount":589,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png","keywords":["caching","redis","redis cache"],"articleSection":["Caching","WooCommerce","WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/","url":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/","name":"How to Use Redis for API Caching in WooCommerce Plugin - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png","datePublished":"2023-08-14T05:21:33+00:00","dateModified":"2025-04-29T11:18:53+00:00","description":"Showing installation and Implementation of Redis caching server with the help of PHPfastecache library in woocommerce addons.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/08\/redis-cli-ping.png","width":383,"height":153,"caption":"redis-cli-ping"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-use-redis-api-caching-in-woocommerce-plugin\/#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 WooCommerce Plugin"}]},{"@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\/a2c513ba357ca0781d2ea37d9da0f076","name":"Dinesh Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/deaa9c46b9b57fbb117ac9a9e51ff5835f9320bd26661dd55bb9a162fc24d905?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/deaa9c46b9b57fbb117ac9a9e51ff5835f9320bd26661dd55bb9a162fc24d905?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Dinesh Yadav"},"description":"Dinesh Yadav, a seasoned Technical Project Manager in the WordPress department, excels in Marketplace Development Services. With deep expertise in WooCommerce modules. He crafts tailored solutions, optimizing performance and ensuring seamless user experiences for complex, scalable online marketplaces.","url":"https:\/\/webkul.com\/blog\/author\/dineshyadav-wp\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/394340","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\/498"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=394340"}],"version-history":[{"count":19,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/394340\/revisions"}],"predecessor-version":[{"id":490438,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/394340\/revisions\/490438"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=394340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=394340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=394340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}