To view the portfolio project click here.
http://tulysg.github.io/Front-End-NanoDegree-Project4/
####Part 1: Optimize PageSpeed Insights score for index.html
- Optimized image pizzeria.jpg from W: 2048px, H:1536 px to a new size of W: 100px, H: 75px for index.html page.
- Customized image, title, header and email address on index.html.
- async was added to google analytics script.
- On css/print.css link, media="print" was added so that it loads only when print command is given.
- On index.html, moved the google webfont link at the end of the page.
- minified and inlined style.css file. 7.Created pizzeria-big.jpg for pizza.html page so that index.html has only small size jpg .
To view pizza.html click here.
http://tulysg.github.io/Front-End-NanoDegree-Project4/views/pizza.html
####Part 2: Optimize Frames per Second in pizza.html.
The following changes were made to views/js/main.js
- On document. addEventListener, looped through 32 instead of 200 pizza.
- On function changePizzaSizes, changed querySelectorAll with getElementsByclassName and moved the variables from for loop to outside of loop.
- Changed all querySelector to getElementById for performance improvement.
- Created a new function NewPizza() to generate random pizzas and appends all the pizzas only once ;
- Moved document.body.scrollTop outside of the for loop in updatePositions function;
- Added will-change: transform on style.css.
- Optimizing Performance
- Analyzing the Critical Rendering Path
- Optimizing the Critical Rendering Path
- Avoiding Rendering Blocking CSS
- Optimizing JavaScript
- Measuring with Navigation Timing *The fewer the downloads, the better *Reduce the size of text *Optimize images *HTTP caching
- http://www.imageoptimizer.net/Pages/Home.aspx