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!
Topic summary
A developer is experiencing delays when updating shop-level metafields in Shopify—changes made in the admin don’t immediately appear on the storefront due to aggressive caching.
Issue Details:
- Metafield accessed via
{{ shop.metafields.myconfig }}in Liquid theme code - Old cached values persist after updates, hindering testing and deployment
- Caching behavior cannot be disabled or configured
Suggested Workaround:
- Manually trigger cache invalidation during development by “touching” the theme
- Method: Open any theme file (e.g.,
theme.liquid) in the code editor, make a trivial change (add a space), and save - This forces Shopify to serve fresh metafield values
Status: The issue is confirmed as expected Shopify behavior with a temporary development workaround provided. No permanent solution for eliminating the cache delay is available.
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!