Is it possible to serve a page while loading?


#1

Hello. :slight_smile:

Due to my Project taking a bit to load (glitch starting up, connecting to Database and doing stuff) I wanted to know whether we are able to serve static pages while the Project starts up. My Project takes around 8-10 seconds to load and while loading it looks like the browser is “hanging” for those 8-10 seconds since nothing is served.

So is it possible to serve something while the Project is loading/starting up?

Thank you for glitch and the good support. (:

Julian


#2

Hi @nailujx86,

we had a “loading page” but it didn’t work well with some browsers, so we removed it for now… but if there is interest we can try to put it back :slight_smile:


#3

Hi @etamponi,

Did you remove it just recently because I remember that there used to be a loading thingie a few weeks ago?


#4

Yes, we had it for a short period of time, perhaps a couple months ago, I don’t remember exactly


#5

hi! what is your app doing before it shows the content - is it the db stuff taking long? or is it mostly glitch starting up that’s been slow for you?

if it’s your app’s logic, you can serve your page and have it initially show “loading” content, then have the client call the server for the db info and on retrieval show the page you want to show - i made this app as an example: https://glitch.com/edit/#!/east-pot

if it’s just glitch starting up, we definitely need to look into that because 8-10 seconds if very long!!


#6

Thank you. I never thought of this way of solving the Problem. (:
And no, it’s not glitchs Problem. It is just the connection to my database which takes a bit and since I’m waiting for it before I send anything back it takes a few seconds. (It takes a few seconds on my local dev environment as well so it isn’t a glitch speed issue either)

Thank you for your great Support though!