Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
On my site, I attached some updated images to my Collections. I've waited over 36 hours now and the CDN is still serving the old image.
I have a temporary workaround - where I bust the image cache for the banner image on Collections pages - but since Shopify doesn't seem to give us the ability to clear our CDN cache, I'm just wondering if there is another solution.
I would like to still be able to leverage the CDN and caching for serving this image if possible, but this seems to be the only thing that shows the update at the moment.
I've included a couple screenshots below and this is my code snippet with the 'cache_buster' query approach.
Would love to know if there's a bett
{% assign cache_buster = 'now' | date: '%s' %} {% assign collection_img_src=collection.image.src | append: '?v=' | append: cache_buster %}
New Image Attached to Collection in Shopify Admin
Cache-Busted Image (new)
Solved! Go to the solution
This is an accepted solution.
I waited over a week and my page content updates still hadn't shown up!
I think I found a better workaround than the cache-busting technique. It involves getting the current 'page' or 'collection' data by getting the current 'handle' and then setting variables based on this type of pattern:
{% assign collection_handle = collection.handle %}
{% assign collection_object = collections[collection_handle] %}
{% assign collection_img_src=collection_object.image.src %}
For anyone else experiencing what appear to be super long caching times - you might try this - which involves referring to the 'page' or 'collection' you want data from by getting the handle - and then using that as the key for the 'pages' or 'collections' arrays.
I'm not sure if this is the case or even why it would be - but it seems like the default 'collection' and 'page' objects are being cached - but the data in 'pages' and/or 'collections' arrays are not - so this is our way around that - while still hopefully getting better speed performance than cache-busting.
I'm actually noticing some caching issues with my page content as well. I made some text changes to one of my Page's content. It's now been over 48 hours and it's still showing the old page content.
When I look at the page content within Shopify admin, I see my updates. However, the value assigned to 'page.content' is still pulling in the old data.
It would be great if Shopify gave us a way to flush our site cache. Otherwise, how can we request to have the cache - in what I'm guessing is due to the CDN - flushed?
This is an accepted solution.
I waited over a week and my page content updates still hadn't shown up!
I think I found a better workaround than the cache-busting technique. It involves getting the current 'page' or 'collection' data by getting the current 'handle' and then setting variables based on this type of pattern:
{% assign collection_handle = collection.handle %}
{% assign collection_object = collections[collection_handle] %}
{% assign collection_img_src=collection_object.image.src %}
For anyone else experiencing what appear to be super long caching times - you might try this - which involves referring to the 'page' or 'collection' you want data from by getting the handle - and then using that as the key for the 'pages' or 'collections' arrays.
I'm not sure if this is the case or even why it would be - but it seems like the default 'collection' and 'page' objects are being cached - but the data in 'pages' and/or 'collections' arrays are not - so this is our way around that - while still hopefully getting better speed performance than cache-busting.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024