We had implemented some JSON view pages for a client that relied on the ?cache=false URL parameter. Recently however it seems this has stopped working on the live theme. It does appear to still work when previewing a theme.
Has anyone else experienced this or have any insight?
I had reached out to support last week but they were not very helpful. It seemed the person I was dealing with was not even aware of the feature. At this point I am still without a solution. Was hoping Jason (freakdesign) would have chimed in as he seems to be the one of the only places on the internet referencing it.
cache=false was never an officially documented property so using it was a bit of a hack. Iāve used it before in some old builds, and Iāve got a bunch of blog posts on the topic. However, being undocumented I also knew the lifetime was limited, and it could be removed at any point. Opting to not return cache has performance concerns for everyone.
Iād be suggesting that devs look into alternate approaches that use JavaScript instead, or leverage other aspects of Shopify like search results, filtered collections, alternate templates, etc that can return the data set you need.
If youāre using a querystring to determine what collection to show (since thatās the most recent post in this thread) that sounds like something you could achieve with JS.
If you have absolute must have use cases Iād be interested to know what they are.
Experiencing the same issue. If you open the request in new window/tab then it will provide you fresh content whereas in ajax request cached content is loaded. Any work around for this one? We have lots of things which are dependent on this one in our store.
Shopify should provide alternate method for this one.
I put a fake parameter on the end of the url based on the milliseconds of the current time of the request, which shopify ignores, but which causes it to not be cachable. e.g. &cache=20394823 - different value every time.
Paul_West Iāve tried that approach with no success. Any other possible option to solve this issue?
I have a special page (not a product one) that will load a different product depending on the query string. I canāt think of another way of solving this problem.
When Facebook scrapes the output it never gets the latest version and caches itās first response. I presume this is the Shopify cache working in the network between Facebook and Shopify (Cloudflare?).
So..
How to best signal that this page shouldnāt be cached? Iām currently testing using cache=false
My use case is that I want my contact form to receive the product information from the product page that the user came from so that I can populate the data into the form that will be submitted.
What other options are there? &cache=false is having very mixed results for me, assumedly because of caching behavior.
Yes, you can also use this approach in collections pages. Since you want to post these feeds in Facebook or Google then there is no need of javacript approach.
{% layout none %}
{% comment %} Iterate through products which are available in the collection{% endcomment %}
{%- for product in collection.products %}
......
{%- endfor -%}
Donāt forgot to use pagination. You will not be able to get more than 50 products at a time. This is limitation of Shopify.
Hi Chintan, the feed is working perfectly and integrates to FB without issues. The problem is that the output is CACHED hence my posting on this thread.
But. Facebook (correctly) keeps a cache of this page on itās scraping server thinking itās a web url.
I can clear this cache by using the Facebook Debugger to scrape it again and get new content. But this doesnāt help when the Facebook Catalog data feed auto schedules a load every hour and wonāt see the updated content.
Perhaps if I knew how to make the output have the .xml extension FB wouldnāt cache it?
All the above methods do not work, pages with different GET parameters are also cached. We did a little research and found out that there are parameters that Shopify does not cache, for example, āquantityā and ātypeā, maybe there are others. Now we pass the current timestamp to ātypeā and everything works fine.