{"id":298842,"date":"2021-08-02T07:20:05","date_gmt":"2021-08-02T07:20:05","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=298842"},"modified":"2024-02-20T07:11:50","modified_gmt":"2024-02-20T07:11:50","slug":"custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/","title":{"rendered":"Custom Extension Cache Management with Fastly in adobe commerce cloud"},"content":{"rendered":"\n<p>Magento2 cloud edition(Adobe commerce) require Fastly cache with varnish for provide fast caching and a CDN. For more details about fastly for cloud for <a href=\"https:\/\/webkul.com\/adobe-commerce-cloud\/\">adobe commerce development<\/a> please check <a href=\"https:\/\/devdocs.magento.com\/cloud\/cdn\/configure-fastly.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/devdocs.magento.com\/cloud\/cdn\/configure-fastly.html<\/a> .<\/p>\n\n\n\n<p>So as a developer many times we need to flush cache using code in our custom extensions, and for that we need to write cache flush code, but in magento2 cloud edition, to work with fastly, we need to send purge request to fastly and for that fastly is using &#8216;adminhtml_cache_flush_all&#8217; event observer to send purge request.<\/p>\n\n\n\n<p>So please check the code for flushing cache to compatible with fastly-<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/**\n * @var \\Magento\\Framework\\App\\Cache\\Manager\n *\/\nprotected $cacheManager;\n\n\/**\n * @var \\Magento\\Framework\\Event\\ManagerInterface\n *\/\nprotected $eventManager;\n \npublic function __construct(\n    \\Magento\\Framework\\App\\Cache\\Manager $cacheManager,\n    \\Magento\\Framework\\Event\\ManagerInterface $eventManager\n){\n      $this-&gt;cacheManager = $cacheManager;\n      $this-&gt;eventManager = $eventManager;\n}\n \npublic function cacheFlush()\n{\n     $availableTypes = $this-&gt;cacheManager-&gt;getAvailableTypes();\n     $this-&gt;eventManager-&gt;dispatch(&#039;adminhtml_cache_flush_all&#039;);\n     $this-&gt;cacheManager-&gt;flush($availableTypes);\n}<\/pre>\n\n\n\n<p>Now you are ready to go, your extension is compatible with Fastly.<\/p>\n\n\n\n<p>you can get more magento2 (Adobe Commerce) articles <a href=\"https:\/\/webkul.com\/blog\/?s=magento2\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento2 cloud edition(Adobe commerce) require Fastly cache with varnish for provide fast caching and a CDN. For more details about fastly for cloud for adobe commerce development please check https:\/\/devdocs.magento.com\/cloud\/cdn\/configure-fastly.html . So as a developer many times we need to flush cache using code in our custom extensions, and for that we need to write <a href=\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-298842","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Adobe commerce cloud Custom Extension Cache with Fastly cache<\/title>\n<meta name=\"description\" content=\"Custom Extension Cache Management with Fastly in Adobe commerce cloud. In Magento2 cloud edition(adobe commerce), Fastly is required ....\" \/>\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\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adobe commerce cloud Custom Extension Cache with Fastly cache\" \/>\n<meta property=\"og:description\" content=\"Custom Extension Cache Management with Fastly in Adobe commerce cloud. In Magento2 cloud edition(adobe commerce), Fastly is required ....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/\" \/>\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=\"2021-08-02T07:20:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-20T07:11:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abhishek Singh\" \/>\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=\"Abhishek Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/\"},\"author\":{\"name\":\"Abhishek Singh\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/573e459f54796eb4195511990de4bfd0\"},\"headline\":\"Custom Extension Cache Management with Fastly in adobe commerce cloud\",\"datePublished\":\"2021-08-02T07:20:05+00:00\",\"dateModified\":\"2024-02-20T07:11:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/\"},\"wordCount\":141,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/\",\"url\":\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/\",\"name\":\"Adobe commerce cloud Custom Extension Cache with Fastly cache\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2021-08-02T07:20:05+00:00\",\"dateModified\":\"2024-02-20T07:11:50+00:00\",\"description\":\"Custom Extension Cache Management with Fastly in Adobe commerce cloud. In Magento2 cloud edition(adobe commerce), Fastly is required ....\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Custom Extension Cache Management with Fastly in adobe commerce cloud\"}]},{\"@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\/573e459f54796eb4195511990de4bfd0\",\"name\":\"Abhishek Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d4ac7e0e671bf743359d7e3f140c262d1b16d71106f0a1aeaecca327a2805ae4?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\/d4ac7e0e671bf743359d7e3f140c262d1b16d71106f0a1aeaecca327a2805ae4?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Abhishek Singh\"},\"description\":\"Adobe Commerce certified Magento developer with over 12 years of experience at Webkul. Passionate about scalable Magento 2-based webshops, AI, and multi-channel integrations, Abhishek consistently delivers innovative and efficient e-commerce solutions that propel businesses forward.\",\"sameAs\":[\"http:\/\/webkul.com\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/abhishek\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adobe commerce cloud Custom Extension Cache with Fastly cache","description":"Custom Extension Cache Management with Fastly in Adobe commerce cloud. In Magento2 cloud edition(adobe commerce), Fastly is required ....","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\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/","og_locale":"en_US","og_type":"article","og_title":"Adobe commerce cloud Custom Extension Cache with Fastly cache","og_description":"Custom Extension Cache Management with Fastly in Adobe commerce cloud. In Magento2 cloud edition(adobe commerce), Fastly is required ....","og_url":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-08-02T07:20:05+00:00","article_modified_time":"2024-02-20T07:11:50+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Abhishek Singh","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Abhishek Singh","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/"},"author":{"name":"Abhishek Singh","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/573e459f54796eb4195511990de4bfd0"},"headline":"Custom Extension Cache Management with Fastly in adobe commerce cloud","datePublished":"2021-08-02T07:20:05+00:00","dateModified":"2024-02-20T07:11:50+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/"},"wordCount":141,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/","url":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/","name":"Adobe commerce cloud Custom Extension Cache with Fastly cache","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2021-08-02T07:20:05+00:00","dateModified":"2024-02-20T07:11:50+00:00","description":"Custom Extension Cache Management with Fastly in Adobe commerce cloud. In Magento2 cloud edition(adobe commerce), Fastly is required ....","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/custom-extension-cache-management-with-fastly-in-adobe-commerce-cloud\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Custom Extension Cache Management with Fastly in adobe commerce cloud"}]},{"@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\/573e459f54796eb4195511990de4bfd0","name":"Abhishek Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d4ac7e0e671bf743359d7e3f140c262d1b16d71106f0a1aeaecca327a2805ae4?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\/d4ac7e0e671bf743359d7e3f140c262d1b16d71106f0a1aeaecca327a2805ae4?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Abhishek Singh"},"description":"Adobe Commerce certified Magento developer with over 12 years of experience at Webkul. Passionate about scalable Magento 2-based webshops, AI, and multi-channel integrations, Abhishek consistently delivers innovative and efficient e-commerce solutions that propel businesses forward.","sameAs":["http:\/\/webkul.com"],"url":"https:\/\/webkul.com\/blog\/author\/abhishek\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/298842","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=298842"}],"version-history":[{"count":15,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/298842\/revisions"}],"predecessor-version":[{"id":423041,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/298842\/revisions\/423041"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=298842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=298842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=298842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}