Page taking 5–12 seconds to load on first visit, but 1–2 seconds on subsequent loads — how to optimize first-time preload?
0
Hi everyone, I’m facing a performance issue in my Mendix app where a particular page takes around 5–12 seconds to load the first time, but after that, it loads in just 1–2 seconds, which is expected once things are cached. From the browser Network tab, I can see multiple JavaScript files, fonts, and SVGs being fetched on the first load — most of them served through the Service Worker. After this initial load, everything comes from cache and the page is very fast. Is there a recommended way in Mendix to optimize or reduce the first-time load (preload) for such pages?Some additional details: The environment is Mendix Cloud. Static resources (JS, fonts, SVGs) are being downloaded on the first load. After that, page transitions are very fast. I’m looking for best practices or configurations to help improve this first-time load — for example, whether Mendix provides options to preload or bundle resources differently, or any techniques used in production apps to make the initial page load faster. Thanks in advance!
asked
Rishi Sundar
1 answers
0
hi,
This is expected behavior in Mendix Cloud and is caused by the initial Mendix client bootstrap, not by your page or database.
On the first load, Mendix must download and initialize:
The client runtime (JS bundles)
Widgets and Atlas UI
Fonts, SVGs, icons
The Service Worker
Initial client state
After this, the Service Worker caches everything, which is why subsequent loads are fast.
Mendix does not provide a configuration to manually preload, rebundle, or optimize JS like a custom React app. This is by design.
What you can do (and what actually works)
Use a lightweight landing page
Make the first page very simple
No Data Grid 2, Charts, or heavy widgets
Navigate to heavy pages after load
This gives the biggest perceived improvement
Reduce widget/module bloat
Remove unused Marketplace modules
Each widget adds JS to the initial bundle
Lazy-load heavy UI
Load grids, charts, and media only after navigation
Avoid microflow datasources on the entry page
Accept the first-load cost
Mendix Cloud already uses CDN + Service Worker caching
There is no supported way to make the very first load instant