{"id":1177,"date":"2020-01-04T09:11:50","date_gmt":"2020-01-04T02:11:50","guid":{"rendered":"https:\/\/lab.wptips.dev\/?p=1177"},"modified":"2020-06-14T19:49:06","modified_gmt":"2020-06-14T12:49:06","slug":"acf-fields-cache","status":"publish","type":"post","link":"https:\/\/pixelstudio.id\/blog\/acf-fields-cache\/","title":{"rendered":"How to Cache ACF Fields (And Make it Faster)"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\"><p><strong>ACF<\/strong> (Advanced Custom Fields) is a plugin to create user-friendly custom fields. <a href=\"https:\/\/www.advancedcustomfields.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Visit their website<\/a> to learn more.<\/p><\/blockquote>\n\n\n\n<p>Instead of saving the Field Groups setting into the database, you can do so in your theme folder.<\/p>\n\n\n\n<p>I heavily recommend doing this because it <strong>improves the loading speed<\/strong> in both front-end and back-end.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Create \/acf-json Folder in Your Theme<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2020\/01\/acf-json-create-folder.jpg\" alt=\"\" class=\"wp-image-1184\" width=\"720\" height=\"386\" srcset=\"https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2020\/01\/acf-json-create-folder.jpg 750w, https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2020\/01\/acf-json-create-folder-480x258.jpg 480w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><figcaption>Create <code>\/acf-json<\/code> folder in your theme<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2. Done<\/h2>\n\n\n\n<p>Seriously?<\/p>\n\n\n\n<p>Yes! now every time you save a Field Group, it will create a JSON file in that folder automatically.<\/p>\n\n\n\n<p>For existing Field Groups, open all one by one and <strong>re-save them<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"211\" src=\"https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2020\/01\/acf-json-sample.jpg\" alt=\"\" class=\"wp-image-1185\" srcset=\"https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2020\/01\/acf-json-sample.jpg 644w, https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2020\/01\/acf-json-sample-480x157.jpg 480w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><figcaption>JSON files that are saved automatically<\/figcaption><\/figure><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-dots\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>As stated above, you should apply this tip on all your sites that use ACF.<\/p>\n\n\n\n<p>Not only for a performance boost, but it also helps with syncing different installations and <strong>version control it with Git<\/strong>.<\/p>\n\n\n\n<p class=\"has-small-font-size\"><strong>Note<\/strong>: Sorry for the lack of update, it&#8217;s been a busy end of the year \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Instead of saving the Field Groups setting into the database, you can do so in your theme folder.<\/p>\n","protected":false},"author":1,"featured_media":1187,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20,29],"class_list":["post-1177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-acf","tag-acf","tag-performance"],"blocksy_meta":{"page_structure_type":"default","page_enable_vertical_spacing":"yes","has_hero_section":"default","hero_section":"type-1","hero_alignment1":"left","hero_alignment2":"center","hero_height":"230px","page_title_bg_type":"color","926b833c43ec2e186e43974c513818c5":"","custom_hero_background":{"attachment_id":null},"parallax":{"desktop":false,"tablet":false,"mobile":false},"bf8a76f25aba93a5714e114aafe493d5":"","single_meta_elements":{"author":true,"date":true,"categories":true,"comments":true,"updated":false,"tags":false},"has_meta_label":"yes","date_format_source":"custom","single_meta_date_format":"M j, Y","ed5c7cc9a2ba393b9c13d77035eb1755":"","page_excerpt_visibility":{"desktop":true,"tablet":true,"mobile":false},"pageTitleFont":{"family":"Default","variation":"Default","size":{"desktop":"32px","tablet":"30px","mobile":"25px"},"line-height":"1.3","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"CT_CSS_SKIP_RULE","text-decoration":"CT_CSS_SKIP_RULE"},"pageTitleFontColor":{"default":{"color":"var(--paletteColor4)"}},"pageMetaFont":{"family":"Default","variation":"n6","size":{"desktop":"12px","tablet":"12px","mobile":"12px"},"line-height":"1.3","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"uppercase","text-decoration":"CT_CSS_SKIP_RULE"},"pageMetaFontColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"hover":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageExcerptFont":{"family":"Default","variation":"n5","size":"CT_CSS_SKIP_RULE","line-height":"CT_CSS_SKIP_RULE.65","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"CT_CSS_SKIP_RULE","text-decoration":"CT_CSS_SKIP_RULE"},"pageExcerptColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageTitleOverlay":{"default":{"color":"rgba(41, 51, 60, 0.2)"}},"pageTitleBackground":{"default":{"color":"#EDEFF2"}}},"_links":{"self":[{"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/posts\/1177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/comments?post=1177"}],"version-history":[{"count":4,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/posts\/1177\/revisions"}],"predecessor-version":[{"id":1578,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/posts\/1177\/revisions\/1578"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/media\/1187"}],"wp:attachment":[{"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/media?parent=1177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/categories?post=1177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/tags?post=1177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}