Optimization
On my desktop, I have successfully achieved a high page speed score of 96 on this site: https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.usstoragecenters.com%2Fstorage-units%2Fca%2Falhambra%2F2500-w-hellman-ave&tab=desktop
Current Status:
Despite efforts to improve the score, especially for mobile devices, it has unfortunately decreased to 69 on desktop. You can view the results here: https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fstage.usstoragecenters.com%2Fstorage-units%2Fca%2Falhambra%2F2500-w-hellman-ave%3Fplain%3Dtrue&tab=mobile
Challenge Faced:
The move from Angular (first link) to plain JavaScript (second link) was intended to improve performance, but unexpectedly caused a drop in Google PageSpeed Insights score.
The reduction in resource size, particularly JavaScript (from 2MB on prod to 500KB on stage), was an attempt to enhance speed.
Evaluation Results:
Comparing the First Contentful Paint metric between prod and stage, there seems to be a delay despite the latter having fewer resources. This anomaly raises concerns about render times.
An analysis of mobile thumbnails suggests that stage loads initial content quicker than prod, contrary to expectations.
https://i.sstatic.net/mALMg.png
Highlighted visuals point out differences in completion time between stage (top) and prod (bottom).
Showcase:
Sample screenshots showcase variations in PageSpeed Insight readings due to differing run times.
Stage example:
https://i.sstatic.net/zWMyR.png
Production snapshot:
https://i.sstatic.net/DTqE2.png
Revamp Efforts:
Key adjustments made during optimization attempts are listed below:
- Migrated from Angular to plain JavaScript, drastically reducing script dependence.
- Implemented lazy loading for JavaScript and images.
- Decreased DOM elements significantly from 4,600 to 1,700.
- Utilized HTTP/2 server push for expedited loading of new scripts.
These modifications were expected to enhance page speed.
Inquiry:
Why did the PageSpeed score drop despite implementing these enhancements?