In this support article, we will discuss how to reduce the number of requests your Bubble.io app generates for improved performance, faster loading times, and reduced consumption of Workflow Units (WUs). We will explain the significance of requests and provide examples of how to query data efficiently.
Understanding Requests in Bubble.io
Estimating Requests Per View
On average, multi-page apps make 5 requests per view, while single-page apps make 2 requests per view. Apps with inefficient setups or complex interactions, such as multiple searches, workflows, or API calls, may generate even more requests per view.
Strategies for Reducing Requests in Your Bubble.io App
Efficient Data Querying
Instead of performing multiple searches, consolidate similar queries to reduce the number of requests. For example, use a single state on the page to hold all "To-Do" items and filter the results within repeating groups, rather than performing separate searches for new, in-progress, and finished tasks.
Consolidating External API Calls
When obtaining data from multiple external APIs, consider creating a backend API that fetches all required data in a single request, rather than sending multiple requests for each API.
Using Single-Page Apps
Single-page apps usually generate fewer requests than multi-page apps, as they only load data from Bubble once for each page visit, thus reducing the number of requests.
Reducing the number of requests in your Bubble.io app will not only improve its overall performance but will also lower the consumption of Workflow Units (WUs). By implementing efficient data queries, consolidating API calls, and opting for single-page apps, you can create a more responsive and cost-effective app experience for your users.