FRONT END PERFORMANCE
- development
- performance
In reality most web pages spend 10-20% of the end user response time spent on getting the content from the web server top the browser. The rest, 80-90% will be spent on rendering the web page, loading components etc.
Parallel Requests
Optimizing Web Performance
Let's examine the rules for web performance optimization.
- Make fewer HTTP Requests
- Use a Content Delivery Network (CDN)
- Add an Expires Header
- Gzip Components
- Put Stylesheets at the Top
- Put Scripts at the Bottom
- Avoid CSS Expressions
- Make JavaScript & CSS External
- Reduce DNS Lookups
- Minify JavaScipt
- Avoid Redirects
- Remove Duplicate Scripts
- Configure Etags
Make fewer HTTP Requests
When your web page loads in a browser, the browser sends an HTTP request to the web server for the page in the URL. Then, as the HTML is delivered, the browser parses it and looks for additional requests for images, scripts, CSS, and so on. Every time it sees a request for a new element, it sends another HTTP request to the server.
How to Reduce HTTP Requests Without Effecting Your Design?
Luckily, there are several ways you can reduce the number of HTTP requests, while maintaining high-quality, rich web designs.
Combined files- Using external style sheets and scripts is important to keep them from bogging down your page load times, but don’t have more than one CSS and one script file.CSS Sprites- When you combine most or all of your images into a sprite, you turn multiple images requests into just one. Then you just use the background-image CSS property to display the section of the image you need.Image Maps- Image maps are not as popular as they once were, but when you have contiguous images they can reduce multiple HTTP image requests down to just one.
Advantage of Caching
Use a Content Delivery Network (CDN)
A content delivery network (CDN) is a gathering of web servers circulated over different areas to convey content all the more effectively to clients.
Add an Expires Header
Express headers as stated, instructs the browser to requests a file from either the cache or the server. This will dramatically decrease the amount of repeated HTTP requests and hence increase the load time.