Hi everyone, I’m running into an issue with a shop-level metafield that I’m exposing through Liquid. I’m using a snippet like {{ shop.metafields.myconfig }} in my theme, but I’ve noticed that whenever I update the metafield in the admin, the changes don’t immediately reflect on the storefront. It seems like the value is being cached and the old data keeps showing for quite a while before it updates, if updated at all! This is causing delays in testing and deploying updates. Does anyone know if there’s a way to reduce or bypass this caching behavior for metafields? Any guidance would be much appreciated!
Hi @dyvan
You are correct; this is a known behavior with Shopify. Shop-level metafields are aggressively cached for storefront performance, which is why you see a delay when trying to view your updates. While you cannot change this caching, there are a few standard workarounds.
For a quick fix during development, the fastest way to see a change is to manually bust the cache. After updating the metafield, you can simply go to your theme’s code editor, open any file like theme.liquid, add a space, and then save it. This “touch” to the theme is usually enough to make Shopify serve the fresh metafield value.
Hope this helps!