Hi Speed peeps!
Do you know if there is a way to target viewports with liquid? I just downloaded the Shopify Chrome extension to see the impact of liquid in our store, and found out that the mobile menu and desktop menu both take almost 500ms to render/compile. So I'm trying to find a way to achieve that using liquid. Any ideas?
Impossible. Liquid is rendered server side.
Actually thats not true, Shopify could check for user agents and use that to create an option to serve screen size conditional code, but they don't have that implemented right now, I doubt they will in the near future as it's impractical, problematically inconsistent, to do, and requires a fair amount of work.
Blah, I did know that, and I've been looking for similar things in the past and learned that it's only for server-side stuff.
However, I do have Cloudflare set up for our shop. And Cloudflare knows the user agents and so on. Perhaps it could be possible to do something with that? Perhaps I could set something up in Cloudflare, that will pass on to Shopify for it to render more effectively?