Can I cache embedded app or make it load faster than 10 seconds?

Hello dear community,

The question I have is: Can I do anything to cache some assets, pre-load some stuff, or anything like that to have my embedded app load faster?

The problem I have now is that the whole thing that is shown on the screenshot takes insanely long - sometimes 7 seconds, sometimes 10. This is pretty annoying for users. I have already put a pre-loader on my side of things, like "wait, the content is loaded until it starts loading the iframe, then it loads the iframe, then it loads all the assets - it is insanely long". Can I somehow cache speed it up, optimize it to load faster?

Hi @Bogdan_Mind,

Apologies for the slow loading time. Let me check with the team for external apps to see if they have any suggestions. I do not believe there is a way to cache some assets but let me double check to confirm.

Just talked to an engineer. Embedded iframes should not have any more overhead than a regular Retool app, I am curious are you loading images/videos/large files in the Retool iframe?

Or are you running any very large queries or a large number of components? From the engineer "any of our general recommendations for app performance will lead to benefits for an embedded app.

Pre-requesting some of our assets is an interesting approach, but I'm not sure how much performance we could net with it being in an iframe, and we don't currently support anything fancy with embed there."

So I do not believe there is much we can do besides query optimizing as well as query caching

I assume it takes so much time because it initially gets the user session via API then it gets the contents of the web page which to embed. I'm not just purely embedding ritual I'm doing that via API with authentication in retool because that's the only way to do so now. I assume it takes minimum 10 seconds?

Ah ok thank you for the added details. Are you using Retool's API to get the user session?

Let me check with the team on if there is any ways to optimize this use case and if this is the only way to do so. This could likely be why it takes so long.

I am curious how we could see a breakdown of how much time each of those steps take. Are you self hosted or on cloud?

1 Like

Yes, I am on the cloud, and as far as reading the forum, this issue with embedding Retool to our internal website and authenticating users via API is taking so long because it is individually preparing the session, returning the whole iframe, and then it is rendering. Like some time ago, there was an option to just embed publicly shared pages to the website, but first of all, this is not secure, secondly you do not have user session in there, so you do not know which user and what permissions they are allowed to do. That was the issue, but now with this embedding, I'm just curious on how I can save time in here.

Yes, all my queries are cached and optimized, so it's not an issue here. It just makes a difference when it is loading through my website embedded or when it is loading in the cloud. The cloud is just faster because it is not doing all this extra request.

Ah I see, thank you for sharing the added details.

I am not sure that there is any way to make the embedded iframe faster if you have already optimized the app's performance.

Can you share the app's UUID for me to share with the performance team to see if we can see if there is any additional details we can gather on why its taking 10 second to load?

As you mentioned we moved away from the previous system which was not secure and now there are a series of steps that occur on page load that do add to the time to render. We are definitely looking to improve the performance of Retool apps and embedded iframes, so checking our your apps time from first contact with the Retool server to page render could be helpful for finding any bottlenecks and further optimizing things on our end.

Hi @Bogdan_Mind,

I was curious to hear if you were still experiencing slowness in your app and if any suggestions in my previous comment were useful.

If you could share the app's UUID I can work with engineers to dig into the metrics to see if there is a smoking gun issue that is causing the app to load slowly.