How can I delay specific JS/CSS impacting loading times on Sense Theme?

Topic summary

A Shopify store owner using the Sense theme is experiencing performance issues caused by payment-related JavaScript files from Shopify’s payment sheets (cdn.shopify.com/shopifycloud/payment-sheets/assets/). These files are negatively impacting key performance metrics:

Performance Impact:

  • Increased Total Blocking Time (TBT)
  • Slower Largest Contentful Paint (LCP)
  • Delayed First Contentful Paint (FCP)

Lighthouse testing shows that blocking these 5 payment sheet files significantly improves time to interactive by approximately 2 seconds, with improvements of 0.8s in LCP, 0.5s in FCP, and 400ms in TBT.

Attempted Solutions:

  • Using a third-party app that successfully delays other JS/CSS resources, but doesn’t work for these specific payment sheet files
  • Manually adding async/defer attributes in theme.liquid, which also has no effect on these files

The user is seeking methods to delay or defer loading of these payment-related scripts until after the page loads, but standard deferral techniques aren’t working for these Shopify-generated resources.

Summarized with AI on November 24. AI used: claude-sonnet-4-5-20250929.

I have no problem with delaying most of my non-critical JS/CSS - but there’s this one thing that is increasing my TBT, LCP, and FCP all at once, and that is:

cdn,shopify,com/shopifycloud/payment-sheets/assets/latest/blabla948343-spb-923-en.js

I have about 5 of those links with different endings. I’ve done some tests with lighthouse, and by blocking these 5 links, my overall time to interactive has decreased by 2s, LCP -0.8s, FCP -0.5s., TBT - 400ms

Now - I have an app that delays whatever JS/CSS I want, and it’s working for all apps - but for these links, for some reason - it doesn’t. Manually putting defer/async in the theme.liquid also doesn’t do anything.

By the URL name, I assume it is some payment settings. Any idea how could I delay it - or make it load after the page loads?

I’m using Sense Theme.