Only call collections on certain pages

Thought I’d add this from last week’s changelog in this thread in case you missed it and for future users who may have similar questions :slight_smile:

We did quite a few things to improve performance in the past few weeks.

:rocket: First, we optimized how Collections are loaded in the Editor. This won’t impact your published app but will greatly improve your developer experience while building in WeWeb :slightly_smiling_face:

BEFORE

All the Collections were loaded in the Editor, even if they weren’t used in the page.

All the Collections were loaded every time you went into Preview mode as well.

This slowed you down while you were building, especially when it meant hitting API limits when using Xano or Airtable on a free plan for example.

NOW

We only load the Collections that are used on the page and that have the “Fetch this collection automatically” setting enabled.

Let’s talk more about this setting.

:rocket: We added the option to optimize how you want to load your Collections in the Live Project.

By default, when you add a Collection, it will be fetched automatically on the pages that use that Collection in the Live Project.

However, you can disable the setting to gain full control over when your Collection is loaded:

When you disable the “Fetch this collection automatically” setting, you will need to use the “Fetch collection” Action in a Workflow to load the Collection.

For example, if you use a Collection in a Popup element, you can add a “Fetch collection” Action to the Workflow that is triggered to display the Popup.

2 Likes