mairabay / wc-shippo

WooCommerce Shippo Plugin
0 stars 0 forks source link

Find a way to keep the backend server awake #9

Closed mairabay closed 4 years ago

mairabay commented 4 years ago

otherwise the time it takes to load the cart will be very long when it first awakes

mairabay commented 4 years ago

Try ideas in https://support.glitch.com/t/how-to-make-a-glitch-project-to-run-constantly/2439

mairabay commented 4 years ago

History:

Turns out Glitch has blocked all pinging requests. I created a ticket but the answer was useless: https://support.glitch.com/t/awakening-causes-request-timeouts-due-to-npm-reinstall/3118 While I waited for the answer I noticed a logic error in my plugin code which was only calling the backend twice instead of thrice. Fixing the error has fixed the "no shipping options" message on cart. Every time I tried the cart (reload, add/remove stuff) with long intervals between changes, it always gave me the shipping quotes.

Rationale and future ideas:

It still takes a while to load sometimes, but I think for now I can just live with it. Maybe for the beta test I can try moving it to the cloud or some other more reliable? server. Or maybe not. I get the feeling that all free servers will be the same issue, because they will all put the backend to sleep anyway. Also, once the app gets fairly popular a) this won't be a problem because it won't sleep as much (or at all :) ) and b) once I get people to pay for it I can actually pay for hosting that keeps the app awake. So I am closing this for now, and will re-open or create a new ticket if need be.