Checking app block presence in themes — performance concerns

Hello everyone,

We’re currently in the process of applying for BFS status. One of the requirements raised was that, per section 4.2.3, we need to display the status of our app blocks on the app homepage.

From reading the documentation, it seems like the only way to do this is to:

  1. Fetch the active theme

  2. Fetch all template files from that theme

  3. Check the content of each one for our blocks

After testing this approach with some of our merchants, we found it can take several seconds when they have many templates. We’re concerned about the impact on our app’s performance score if we need to make these requests every time a merchant opens our app homepage.

Our questions:

  • Is there a more efficient way to check for the presence of our app blocks?

  • If not, does the status need to be updated in real-time, or would it be acceptable to cache the results for a short period, or fetch them from our backend at regular intervals via a CRON job?

Thanks in advance for any guidance!

Hey @Gauthier_Roch! The good news is that you don’t need to do this anymore.

await shopify.app().extensions() will give you a list of app blocks, and their status!

Indeed, this is exactly what we needed. Thanks a lot!

1 Like