Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I have written several scripts and tested them in the Preview builds. When those changes are published the to the live theme, I noticed the code breaking and the scripts not running in the network tab. This seems to be due to the Preview Builds having `no-cache no-store` set to server cache, while Published builds have caching on by default. I've attempted to alter the meta-tag headers, implement cache-busting etc. all to no avail.
I'm looking for advice on how to alter the server cache settings without the use of a full-stack framework like Hydrogen or Remix, and/or a method of refactoring to get these scripts to run on cache'd pages somehow.
@DomJM Did you find an answer to your question?
I'm using Liquid and want to prefetch products in the viewport on a product list page. I'm using:
<link rel="prefetch" href="{{ product.url }}" as="document">
The cache-control header is set to no-cache, no-store are also causing issues for me.
Do you know if caching prefetch requests works in production and did you ever find a way to have it work on local dev and preview builds?
I never found a way to successfully break the prod cache. It seems to be a immutable feature; it kind of just does what it does. Unsure about the possibility if you can cache prefetch in prod or other build steps. To break the cache I had to hard reload the page upon navigation using .reload() because I could not toggle the cache settings.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025