I have a webpage using CDN to stream CSS files. The situation I ran into was : My webpage load too fast that when it finished loading, the CSS files (on CDN) are still loading. So that you can see a flash screen with you webpage WITHOUT any styles (cause the css on cdn is not loaded yet). So how can I keep them load synchronously, to prevent that “flash screen”. Thanks 🙂
Share
If caching is configured properly, this would not be an issue – only witnessed by the end user once upon the initial load.
If your site has a dedicated “first visit” landing page (welcome/login/disclaimer etc.), you could include the base styles inline (i.e. only the subset of rules the page immediately relies on) and lazy-load the CSS from your CDN in the background.
That being said, @Musa is absolutely correct: if this is an issue, get a better CDN