Unless has been designed to prevent FOUC and FOOC by inserting content while the DOM is still rendering.
Traditionally, FOUC is a valid concern. But... it is a thing of the past! Through a super fast backend, a clever data format and a smart script design, Unless prevents the Flash Of Unstyled Content entirely.
It works like this: the Unless script will load the personalized content in parallel with your web page. Then, while your web page is still loading like it normally would, we will replace original content with personalizations. So, we replace content before your web page even shows up in your visitors' browsers.
However, to achieve this, there are a few things that have to be taken into account:
If you have any questions or problems, contact us, so we can help you fix it.
As said, Unless uses three things to make FOUC impossible: a super fast, serverless backend, a compact personalization data format based on the smallest delta possible, and a clever loading technique in the client.
Personalizations are served based on audience memberships. These memberships are kept in the dynamic part of the Unless service. This backend is distributed globally (also see question 2), and based on serverless computing only. This means that:
Based on the audience memberships, personalizations are served to the client.
Personalizations are stored as flat JSON files in AWS S3 and served through the global Cloudfront CDN as flat data, which makes it super fast and almost impossible to break (because there is no running code involved).
Assuming that it is placed correctly (as the first thing in the HTML head), the Unless snippet prevents FOUC entirely. The script and subsequent data both load asynchronously, in parallel with the initial parts of your web page. Personalizations are then applied as delta insertions while the DOM of your website is still rendering, using a recursive approach. So, this happens before the visitor even sees anything.
Note: in 99% of all cases, Unless will finish before your website does, but just to be sure, it hides the initial DOM view until the personalization has been applied (and automatically unblocks the DOM after a short while if something would go wrong).