Delete unnecessary downloads
The fastest and best optimized resources are resources that do not need to be downloaded. Have you reviewed resources recently? You should do this, and you should do so regularly to ensure that each resource contributes to a better user experience.
The fastest and most optimal resource is a resource that does not need to be downloaded. Of course, this may seem like a nonsense, but in fact, it is often overlooked: as a performance engineer, your job is to always be critical and seize every opportunity to remove unnecessary resources from your application. Together with your team, it is a good practice to challenge implicit and explicit assumptions and periodically re-check them. For example, here are some examples:
- The resource X is always included on our web page, but is the cost of downloading and displaying the resource proportional to the value it provides to the user? Can we evaluate and prove its value?
- Is this resource-especially a third-party resource-guaranteed to be stable performance? is the resource in the critical path? Or do you need to be in the critical path? If the resource is in a critical path, will it become a single point of failure on our site? In other words, if the resource is not available, will it affect the performance and user experience of the Web page?
- Does the resource require an SLA? Or does it have an SLA? Does the resource follow best practices for improving performance (compression, caching, and so on)?
Our web pages tend to contain unnecessary resources, or, worse, some of the resources that are contained can affect the performance of the Web page and cannot bring too much value to the visitor or site. The same applies to our own and third-party resources and widgets:
- Site A has decided to display a photo loop player on the home page so that visitors can preview multiple photos with just one click-all the photos will load when the page loads and the user can click to view the next photo.
- Question: Do you count how many users view multiple photos in a looping player? You may have created unnecessary expensive download costs for most visitors, allowing them to download a lot of resources that they never needed to watch.
- Site B has decided to install a third-party widget to display relevant content, improve social engagement, or provide some other service.
- Question: Have you tracked how many visitors use this widget or click to browse the content provided by this widget? Can the beneficial impact of the social interaction of this widget offset the adverse effects of the additional overhead required to download it?
As you can see, although removing unnecessary downloads may seem trivial, it's actually the opposite, and doing well often requires a lot of thoughtful thinking and evaluation. In fact, to achieve the best results, you should regularly inventory and reassess each resource on the Web page for the above issues.
Front-end performance optimization (eight)