The term “front end” relates to the interaction between a web application and a user's browser. Front end optimization (FEO) is the process of fine-tuning the web application to make it more browser-friendly and quicker to load under both the perceived and the actual load time. Perceived load time impacts on the overall user experience (UX), while the actual load time is often used as a performance benchmark metric.
The problem occurs due to the limit on the number of concurrent connections a browser can open to a single webhost. This limit exists to protect a server from being overloaded with a high number of HTTP requests. However, it also serves as a bottleneck, often forcing the browser to start queuing connection requests.
As the maximum connection threshold is quickly reached, various FEO techniques are employed to minimize the number of individual page elements or by multiplexing requests.
The HTTP/2 protocol includes multiplexing — a connection method that permits multiple requests and responses to be sent via a single TCP connection.
CDNs further reduce server response time by pre-pooling connections and making certain they remain open throughout a session, improving erformance by eliminating delay times associated with closing and reopening TCP connections.
With optimum file compression, these files can be shrunk to a fraction of their original size to improve site responsiveness. Preferred for its wide adoption, quick encoding/decoding times and high compression rates, GZIP is the most popular file compression choice.
CDNs are commonly used to streamline many optimization tasks, offering auto-file compression and auto-minification features, freeing origin individual web application resources and resolving problematic caching settings on the fly.
Caching allows storage of the web app's largest static files off the server — either on visitors’ local drives or a nearby CDN endpoint. This vastly improves web application load speeds.
Developers write code for easy reading comprehension, with spaces, line breaks and comments — while machines can read it without any of these elements, making them nonessential characters and wasted bandwidth.
Minification during the build process trims code to its barest essentials, often reducing it by half before compression.
Most CDNs also have the capacity to automate code minification of JavaScript, HTML and CSS files on-the-fly, as they’re being sent to visitors’ browsers.
From an actual load time perspective, TTFB is the duration it takes for the first data byte to arrive from a server to the requesting browser. From a perceived load time perspective, however, TTFB is the duration it takes for the browser to parse the first byte after downloading the HTML file.
Only perceived TTFB impacts user experience, making it the more valuable of the two metrics.
Front end delays can comprise more than 80% of your web application response time.