App with many pages but not all loaded at once

@ianb Exactly!

@chrisbonnert the best place to start is this tutorial:

The power of what @ianb and this tutorial is alluding to is that content is loaded dynamically.

From looking at your app, you are trying to load all of the code and images before the app even loads. The problem here is no user is going to see all of this straight away so you are loading content unnecessarily.

I think the right way to go about this is to store all the information for the pages in a data table and only load what you need.

For example: you could use the New Beta: Accelerated Tables and the q.fetch_only() query to search your data table and only return a search iterator with the page numbers. This would be very fast.

Then you can dynamically create the menu using this and when you want to view a page, you load the rest of the data on request.

Our app has data tables with thousands of rows but we only care about loading the ones the user is going to use immediately. The rest get loaded dynamically when they are needed.

I am sure if you go through the News Aggregator tutorial you will see that it will do what you need it to.

@jshaffstall you beat me to it :rofl:

Anvil does this all day every day!!

1 Like