From 7d802d3e42e8e62dd72992ce3726d23d7c4202b9 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Thu, 26 Jan 2023 19:51:49 +0400 Subject: [PATCH] Add content to frontend performance best practices --- .../content/bundlephobia.md | 6 +- .../content/check-dependency-size.md | 13 ++- .../choose-image-format-approprietly.md | 13 ++- .../content/chrome-dev-tools.md | 16 +++- .../content/compress-your-images.md | 20 +++- .../content/concatenate-css-single-file.md | 12 ++- .../content/cookie-size-less-4096-bytes.md | 12 ++- .../content/enable-compression.md | 8 +- .../content/framework-guides.md | 19 +++- .../content/inline-critical-css.md | 14 ++- .../content/keep-cookie-count-below-20.md | 12 ++- .../content/keep-dependencies-up-to-date.md | 11 ++- .../content/keep-ttfb-less-1-3s.md | 9 +- .../content/keep-web-font-under-300k.md | 8 +- .../content/lighthouse.md | 12 ++- .../content/load-offscreen-images-lazily.md | 16 +++- .../content/make-css-files-non-blocking.md | 13 ++- .../content/minify-css.md | 13 ++- .../content/minify-html.md | 11 ++- .../content/minify-your-javascript.md | 13 ++- .../content/minimize-http-requests.md | 7 +- .../content/page-load-time-below-3s.md | 11 ++- .../content/page-speed-insights.md | 6 +- .../content/page-weight-below-1500.md | 12 ++- .../content/pre-load-urls-where-possible.md | 10 +- .../content/prefer-vector-images.md | 6 +- .../content/prevent-flash-text.md | 7 +- .../content/recommended-guides.md | 91 ++++++++++++++++++- .../content/remove-unused-css.md | 11 ++- .../content/serve-exact-size-images.md | 11 ++- .../content/set-width-height-images.md | 6 +- .../content/squoosh-ap.md | 6 +- .../frontend-performance/content/use-cdn.md | 7 +- .../content/use-http-cache-headers.md | 6 +- .../content/use-https-on-your-website.md | 10 +- .../content/use-non-blocking-javascript.md | 21 ++++- .../content/use-preconnect-to-load-fonts.md | 18 +++- .../content/use-same-protocol.md | 4 +- .../use-service-workers-for-caching.md | 9 +- .../content/use-woff2-font-format.md | 12 ++- .../content/web-page-test.md | 4 +- .../TopicOverlay/TopicOverlay.astro | 2 +- tailwind.config.cjs | 15 ++- 43 files changed, 498 insertions(+), 45 deletions(-) diff --git a/src/best-practices/frontend-performance/content/bundlephobia.md b/src/best-practices/frontend-performance/content/bundlephobia.md index 0a1e8f5cb..74096447e 100644 --- a/src/best-practices/frontend-performance/content/bundlephobia.md +++ b/src/best-practices/frontend-performance/content/bundlephobia.md @@ -1 +1,5 @@ -# Bundlephobia \ No newline at end of file +# Bundlephobia + +Bundlephobia is a website and npm package that allows developers to search for the size of any JavaScript package before adding it to their project. It provides information on the size of the package, as well as the size of its dependencies, to help developers make informed decisions about which packages to use and how they may impact the overall size of their application. Bundlephobia also offers badges which can be added to your GitHub README.md file to show the size of your package. + +- [Official Website - Bundlephobia](https://bundlephobia.com/) diff --git a/src/best-practices/frontend-performance/content/check-dependency-size.md b/src/best-practices/frontend-performance/content/check-dependency-size.md index 162b9f1bc..935238f54 100644 --- a/src/best-practices/frontend-performance/content/check-dependency-size.md +++ b/src/best-practices/frontend-performance/content/check-dependency-size.md @@ -1 +1,12 @@ -# Check dependency size \ No newline at end of file +# Check Dependency Size + +> Ensure to use wisely external libraries, most of the time, you can use a lighter library for a same functionality. + +You may be tempted to use one of the 745 000 packages you can find on npm, but you need to choose the best package for your needs. For example, MomentJS is an awesome library but with a lot of methods you may never use, that's why Day.js was created. It's just 2kB vs 16.4kB gz for Moment. + +Always compare and choose the best and lighter library for your needs. You can also use tools like [npm trends](http://www.npmtrends.com/) to compare NPM package downloads counts or [Bundlephobia](https://bundlephobia.com/) to know the size of your dependencies. + +- [ai/size-limit: Prevent JS libraries bloat](https://github.com/ai/size-limit) +- [webpack-bundle-analyzer - npm](https://www.npmjs.com/package/webpack-bundle-analyzer) +- [js-dependency-viewer - npm](https://www.npmjs.com/package/js-dependency-viewer) +- [Size Limit: Make the Web lighter](https://evilmartians.com/chronicles/size-limit-make-the-web-lighter) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/choose-image-format-approprietly.md b/src/best-practices/frontend-performance/content/choose-image-format-approprietly.md index 7bca9fde9..28b7b4c68 100644 --- a/src/best-practices/frontend-performance/content/choose-image-format-approprietly.md +++ b/src/best-practices/frontend-performance/content/choose-image-format-approprietly.md @@ -1 +1,12 @@ -# Choose image format approprietly \ No newline at end of file +# Image Format + +> Choose your image format appropriately + +To ensure that your images don't slow your website, choose the format that will correspond to your image. If it's a photo, JPEG is most of the time more appropriate than PNG or GIF. But don't forget to look a the nex-gen formats which can reduce the size of your files. Each image format has pros and cons, it's important to know these to make the best choice possible. + +Use [Lighthouse](https://developers.google.com/web/tools/lighthouse/) to identify which images can eventually use next-gen formats (like JPEG 2000m JPEG XR or WebP). Compare different formats, sometimes using PNG8 is better than PNG16, sometimes it's not. + +- [Serve Images in Next-Gen Formats](https://developers.google.com/web/tools/lighthouse/audits/webp) +- [What Is the Right Image Format for Your Website?](https://www.sitepoint.com/what-is-the-right-image-format-for-your-website/) +- [PNG8 - The Clear Winner](https://www.sitepoint.com/png8-the-clear-winner/) +- [8-bit vs 16-bit - What Color Depth You Should Use And Why It Matters](https://www.diyphotography.net/8-bit-vs-16-bit-color-depth-use-matters/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/chrome-dev-tools.md b/src/best-practices/frontend-performance/content/chrome-dev-tools.md index f2694ba12..14cae7cd9 100644 --- a/src/best-practices/frontend-performance/content/chrome-dev-tools.md +++ b/src/best-practices/frontend-performance/content/chrome-dev-tools.md @@ -1 +1,15 @@ -# Chrome dev tools \ No newline at end of file +# Chrome DevTools + +Chrome DevTools is a set of web development tools built into the Google Chrome browser. It allows developers to inspect and debug the front-end of web applications. + +Some of the benefits of using Chrome DevTools include: + +- Inspecting and editing HTML and CSS in real-time, which can be useful for identifying and fixing layout issues +- Debugging JavaScript code, including setting breakpoints, stepping through code, and examining the call stack +- Profiling the performance of web pages, including identifying slow-running JavaScript code and analyzing network requests +- Inspecting and debugging browser-side storage, including cookies, local storage, and indexedDB +- Auditing web pages for performance, accessibility, and best practices + +Chrome DevTools are a powerful and essential tool for web developers, as it helps to improve debugging, testing, and optimization of the web application. + +- [Chrome DevTools Docs](https://developer.chrome.com/docs/devtools/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/compress-your-images.md b/src/best-practices/frontend-performance/content/compress-your-images.md index a6298eebe..13dab8236 100644 --- a/src/best-practices/frontend-performance/content/compress-your-images.md +++ b/src/best-practices/frontend-performance/content/compress-your-images.md @@ -1 +1,19 @@ -# Compress your images \ No newline at end of file +# Images Optimization + +> Your images are optimized, compressed without direct impact to the end user. + +Optimized images load faster in your browser and consume less data. + +- Try using CSS3 effects when it's possible (instead of a small image +- When it's possible, use fonts instead of text encoded in your images +- Use SVG +- Use a tool and specify a level compression under 85. + +- [Image Optimization](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/image-optimization) +- [Essential Image Optimization](https://images.guide/) +- [TinyJPG – Compress JPEG images intelligently](https://tinyjpg.com/) +- [Kraken.io - Online Image Optimizer](https://kraken.io/web-interface) +- [Compressor.io](https://compressor.io/compress) +- [Cloudinary - Image Analysis Tool](https://webspeedtest.cloudinary.com) +- [ImageEngine - Image Webpage Loading Test](https://demo.imgeng.in) +- [SVGOMG - Optimize SVG vector graphics files](https://jakearchibald.github.io/svgomg/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/concatenate-css-single-file.md b/src/best-practices/frontend-performance/content/concatenate-css-single-file.md index df44005a0..f9242736f 100644 --- a/src/best-practices/frontend-performance/content/concatenate-css-single-file.md +++ b/src/best-practices/frontend-performance/content/concatenate-css-single-file.md @@ -1 +1,11 @@ -# Concatenate css single file \ No newline at end of file +# CSS Concatenation + +> CSS files are concatenated in a single file (Not always valid for HTTP/2) + +If you are still using HTTP/1, you may need to still concatenate your files, it's less true if your server use HTTP/2 (tests should be made). + +- Use online tool or any plugin before or during your build or your deployment to concatenate your files. +- Ensure, of course, that concatenation does not break your project + +- [HTTP: Optimizing Application Delivery - High Performance Browser Networking (O'Reilly)](https://hpbn.co/optimizing-application-delivery/#optimizing-for-http2) +- [Performance Best Practices in the HTTP/2 Era](https://deliciousbrains.com/performance-best-practices-http2/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/cookie-size-less-4096-bytes.md b/src/best-practices/frontend-performance/content/cookie-size-less-4096-bytes.md index 3760b1230..74e4b1612 100644 --- a/src/best-practices/frontend-performance/content/cookie-size-less-4096-bytes.md +++ b/src/best-practices/frontend-performance/content/cookie-size-less-4096-bytes.md @@ -1 +1,11 @@ -# Cookie size less 4096 bytes \ No newline at end of file +# Cookie Size + +> If you are using cookies, be sure each cookie doesn't exceed 4096 bytes and your domain name doesn't have more than 20 cookies. + +Cookies are exchanged in the HTTP headers between web servers and browsers. It's important to keep the size of cookies as low as possible to minimize the impact on the user's response time. + +- [Cookie specification: RFC 6265](https://tools.ietf.org/html/rfc6265) +- [Cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies) +- [Browser Cookie Limits](http://browsercookielimits.squawky.net/) +- [Website Performance: Cookies Don't Taste So Good - Monitis Blog](http://www.monitis.com/blog/website-performance-cookies-dont-taste-so-good/) +- [Google's Web Performance Best Practices #3: Minimize Request Overhead - GlobalDots Blog](https://www.globaldots.com/googles-web-performance-best-practices-3-minimize-request-overhead/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/enable-compression.md b/src/best-practices/frontend-performance/content/enable-compression.md index 08dce12d0..09fe33751 100644 --- a/src/best-practices/frontend-performance/content/enable-compression.md +++ b/src/best-practices/frontend-performance/content/enable-compression.md @@ -1 +1,7 @@ -# Enable compression \ No newline at end of file +# Enable Compression + +Use a compression method such as Gzip or Brotli to reduce the size of your JavaScript files. With a smaller sizes file, users will be able to download the asset faster, resulting in improved performance. + +- [Check GZIP compression](https://checkgzipcompression.com/) +- [Check Brotli Compression](https://tools.keycdn.com/brotli-test) +- [Can I use... Brotli](https://caniuse.com/#feat=brotli) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/framework-guides.md b/src/best-practices/frontend-performance/content/framework-guides.md index aefe018fa..07befb4aa 100644 --- a/src/best-practices/frontend-performance/content/framework-guides.md +++ b/src/best-practices/frontend-performance/content/framework-guides.md @@ -1 +1,18 @@ -# Framework guides \ No newline at end of file +# Framework Guides + +These guides are intended to help you optimize your application for performance when using a specific framework. + +## Angular + +- [Angular Performance Checklist](https://github.com/mgechev/angular-performance-checklist) + +## React + +- [Optimizing Performance - React](https://reactjs.org/docs/optimizing-performance.html) +- [React image manipulation | Cloudinary](https://cloudinary.com/documentation/react_image_manipulation) +- [Debugging React performance with React 16 and Chrome Devtools.](https://building.calibreapp.com/debugging-react-performance-with-react-16-and-chrome-devtools-c90698a522ad) +- [Build Performant - React](https://web.dev/react/) + +## Vue + +- [Vue - Useful Links|Style Guide and Performance](https://learn-vuejs.github.io/vue-patterns/useful-links/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/inline-critical-css.md b/src/best-practices/frontend-performance/content/inline-critical-css.md index 15e1d8b97..eacdcc7e0 100644 --- a/src/best-practices/frontend-performance/content/inline-critical-css.md +++ b/src/best-practices/frontend-performance/content/inline-critical-css.md @@ -1 +1,13 @@ -# Inline critical css \ No newline at end of file +# Inline Critical CSS + +> The CSS critical (or "above the fold") collects all the CSS used to render the visible portion of the page. It is embedded before your principal CSS call and between `` in a single line (minified if possible). + +Inlining critical CSS help to speed up the rendering of the web pages reducing the number of requests to the server. + +Generate the CSS critical with online tools or using a plugin like the one that Addy Osmani developed. + +- [Understanding Critical CSS](https://www.smashingmagazine.com/2015/08/understanding-critical-css/) +- [Critical by Addy Osmani on GitHub](https://github.com/addyosmani/critical) automates this. +- [Inlining critical CSS for better web performance | Go Make Things](https://gomakethings.com/inlining-critical-css-for-better-web-performance/) +- [Critical Path CSS Generator - Prioritize above the fold content :: SiteLocity](https://www.sitelocity.com/critical-path-css-generator) +- [Reduce the size of the above-the-fold content](https://developers.google.com/speed/docs/insights/PrioritizeVisibleContent) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/keep-cookie-count-below-20.md b/src/best-practices/frontend-performance/content/keep-cookie-count-below-20.md index 34aa842a1..74e4b1612 100644 --- a/src/best-practices/frontend-performance/content/keep-cookie-count-below-20.md +++ b/src/best-practices/frontend-performance/content/keep-cookie-count-below-20.md @@ -1 +1,11 @@ -# Keep cookie count below 20 \ No newline at end of file +# Cookie Size + +> If you are using cookies, be sure each cookie doesn't exceed 4096 bytes and your domain name doesn't have more than 20 cookies. + +Cookies are exchanged in the HTTP headers between web servers and browsers. It's important to keep the size of cookies as low as possible to minimize the impact on the user's response time. + +- [Cookie specification: RFC 6265](https://tools.ietf.org/html/rfc6265) +- [Cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies) +- [Browser Cookie Limits](http://browsercookielimits.squawky.net/) +- [Website Performance: Cookies Don't Taste So Good - Monitis Blog](http://www.monitis.com/blog/website-performance-cookies-dont-taste-so-good/) +- [Google's Web Performance Best Practices #3: Minimize Request Overhead - GlobalDots Blog](https://www.globaldots.com/googles-web-performance-best-practices-3-minimize-request-overhead/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/keep-dependencies-up-to-date.md b/src/best-practices/frontend-performance/content/keep-dependencies-up-to-date.md index 5481de907..0a03b4201 100644 --- a/src/best-practices/frontend-performance/content/keep-dependencies-up-to-date.md +++ b/src/best-practices/frontend-performance/content/keep-dependencies-up-to-date.md @@ -1 +1,10 @@ -# Keep dependencies up to date \ No newline at end of file +# Dependency Updates + +> All JavaScript libraries used in your project are necessary (prefer Vanilla JavaScript for simple functionalities), updated to their latest version and don't overwhelm your JavaScript with unnecessary methods. + +Most of the time, new versions come with optimization and security fix. You should use the most optimized code to speed up your project and ensure that you'll not slow down your website or app without outdated plugin. + +If your project use NPM packages, [npm-check](https://www.npmjs.com/package/npm-check) is a pretty interesting library to upgrade / update your libraries. [Greenkeeper](https://greenkeeper.io/) can automatically look for your dependencies and suggest an update every time a new version is out. + + +- [Vanilla JavaScript for building powerful web applications](https://plainjs.com/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/keep-ttfb-less-1-3s.md b/src/best-practices/frontend-performance/content/keep-ttfb-less-1-3s.md index 370fba3ab..f3faaa627 100644 --- a/src/best-practices/frontend-performance/content/keep-ttfb-less-1-3s.md +++ b/src/best-practices/frontend-performance/content/keep-ttfb-less-1-3s.md @@ -1 +1,8 @@ -# Keep ttfb less 1 3s \ No newline at end of file +# Keep TTFB < 1.3s + +Reduce as much as you can the time your browser waits before receiving data. + +- [What is Waiting (TTFB) in DevTools, and what to do about it](https://scaleyourcode.com/blog/article/27) +- [Monitoring your servers with free tools is easy](https://scaleyourcode.com/blog/article/7) +- [Time to First Byte (TTFB)](https://varvy.com/pagespeed/ttfb.html) +- [Global latency testing tool](https://latency.apex.sh) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/keep-web-font-under-300k.md b/src/best-practices/frontend-performance/content/keep-web-font-under-300k.md index 23364f1c5..b6e0727df 100644 --- a/src/best-practices/frontend-performance/content/keep-web-font-under-300k.md +++ b/src/best-practices/frontend-performance/content/keep-web-font-under-300k.md @@ -1 +1,7 @@ -# Keep web font under 300k \ No newline at end of file +# Keep Web Font Size Under 300kb + +Web fonts are a great way to add style to your website. However, they can also be a major performance bottleneck. The more fonts you use, the more time it takes for the browser to download and render the page. This can lead to a poor user experience and a high bounce rate. + +Webfont sizes shouldn't exceed 300kb (all variants included) and are optimized for performance. + +- [Font Bytes - Page Weight](https://httparchive.org/reports/page-weight#bytesFont) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/lighthouse.md b/src/best-practices/frontend-performance/content/lighthouse.md index d0a5f533a..af1f80099 100644 --- a/src/best-practices/frontend-performance/content/lighthouse.md +++ b/src/best-practices/frontend-performance/content/lighthouse.md @@ -1 +1,11 @@ -# Lighthouse \ No newline at end of file +# Lighthouse + +Lighthouse is an open-source tool developed by Google that is used to audit the performance, accessibility, and SEO of web pages. It is available as a browser extension and as a command-line tool, and it can be run on any web page to generate a report with recommendations for improvement. + +Lighthouse works by simulating the load and interaction of a web page and measuring various performance metrics, such as load time, time to first paint, and time to interactive. It also checks for common issues such as incorrect image sizes, missing alt text, and broken links. + +Lighthouse provides a comprehensive and easy-to-use tool for identifying and fixing performance and accessibility issues on web pages. It is widely used by web developers and is integrated into many popular development tools. + +Visit the following resources to learn more: + +- [Lighthouse - Google Developers](https://developers.google.com/web/tools/lighthouse) diff --git a/src/best-practices/frontend-performance/content/load-offscreen-images-lazily.md b/src/best-practices/frontend-performance/content/load-offscreen-images-lazily.md index d888acbd4..74a9756d9 100644 --- a/src/best-practices/frontend-performance/content/load-offscreen-images-lazily.md +++ b/src/best-practices/frontend-performance/content/load-offscreen-images-lazily.md @@ -1 +1,15 @@ -# Load offscreen images lazily \ No newline at end of file +# Lazy Loading + +> Offscreen images are loaded lazily (A noscript fallback is always provided). + +It will improve the response time of the current page and then avoid loading unnecessary images that the user may not need. + +- Use Lighthouse to identify how many images are offscreen. +- Use a JavaScript plugin like the following to lazyload your images. Make sure you target offscreen images only. +- Also make sure to lazyload alternative images shown at mouseover or upon other user actions. + +- [verlok/lazyload: GitHub](https://github.com/verlok/lazyload) +- [aFarkas/lazysizes: GitHub](https://github.com/aFarkas/lazysizes/) +- [mfranzke/loading-attribute-polyfill: GitHub](https://github.com/mfranzke/loading-attribute-polyfill/) +- [Lazy Loading Images and Video | Web Fundamentals | Google Developers](https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video/) +- [5 Brilliant Ways to Lazy Load Images For Faster Page Loads - Dynamic Drive Blog](http://blog.dynamicdrive.com/5-brilliant-ways-to-lazy-load-images-for-faster-page-loads/) diff --git a/src/best-practices/frontend-performance/content/make-css-files-non-blocking.md b/src/best-practices/frontend-performance/content/make-css-files-non-blocking.md index bba98a53d..5369f9e47 100644 --- a/src/best-practices/frontend-performance/content/make-css-files-non-blocking.md +++ b/src/best-practices/frontend-performance/content/make-css-files-non-blocking.md @@ -1 +1,12 @@ -# Make css files non blocking \ No newline at end of file +# Non-Blocking CSS + +> CSS files need to be non-blocking to prevent the DOM from taking time to load. + +CSS files can block the page load and delay the rendering of your page. Using `preload` can actually load the CSS files before the browser starts showing the content of the page. + +You need to add the `rel` attribute with the preload value and add `as="style"` on the `` element. + +- [loadCSS by filament group](https://github.com/filamentgroup/loadCSS) +- [Example of preload CSS using loadCSS](https://gist.github.com/thedaviddias/c24763b82b9991e53928e66a0bafc9bf) +- [Preloading content with rel="preload"](https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content) +- [Preload: What Is It Good For? — Smashing Magazine](https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/minify-css.md b/src/best-practices/frontend-performance/content/minify-css.md index 73eb4ed63..785239334 100644 --- a/src/best-practices/frontend-performance/content/minify-css.md +++ b/src/best-practices/frontend-performance/content/minify-css.md @@ -1 +1,12 @@ -# Minify css \ No newline at end of file +# Minify CSS + +> All CSS files are minified, comments, white spaces and new lines are removed from production files. + +When CSS files are minified, the content is loaded faster and less data is sent to the client. It's important to always minify CSS files in production. It is beneficial for the user as it is for any business who wants to lower bandwidth costs and lower resource usage. + +Use tools to minify your files automatically before or during your build or your deployment. + +- [cssnano: A modular minifier based on the PostCSS ecosystem. - cssnano](https://cssnano.co/) +- [CSS Minfier](https://goonlinetools.com/css-minifier/) +- [@neutrinojs/style-minify - npm](https://www.npmjs.com/package/@neutrinojs/style-minify) +- [Online CSS Compressor](http://refresh-sf.com) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/minify-html.md b/src/best-practices/frontend-performance/content/minify-html.md index 2fb5e069e..19ce1d08c 100644 --- a/src/best-practices/frontend-performance/content/minify-html.md +++ b/src/best-practices/frontend-performance/content/minify-html.md @@ -1 +1,10 @@ -# Minify html \ No newline at end of file +# Minify HTML +> The HTML code is minified, comments, white spaces and new lines are removed from production files. + +Removing all unnecessary spaces, comments and attributes will reduce the size of your HTML and speed up your site's page load times and obviously lighten the download for your user. + +Most of the frameworks have plugins to facilitate the minification of the webpages. You can use a bunch of NPM modules that can do the job for you automatically. + +- [HTML minifier | Minify Code](http://minifycode.com/html-minifier/) +- [Online HTML Compressor](http://refresh-sf.com) +- [Experimenting with HTML minifier — Perfection Kills](http://perfectionkills.com/experimenting-with-html-minifier/#use_short_doctype) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/minify-your-javascript.md b/src/best-practices/frontend-performance/content/minify-your-javascript.md index f5404fbac..4ba984119 100644 --- a/src/best-practices/frontend-performance/content/minify-your-javascript.md +++ b/src/best-practices/frontend-performance/content/minify-your-javascript.md @@ -1 +1,12 @@ -# Minify your javascript \ No newline at end of file +# Minify JavaScript + +> All JavaScript files are minified, comments, white spaces and new lines are removed from production files (still valid if using HTTP/2). + +Removing all unnecessary spaces, comments and break will reduce the size of your JavaScript files and speed up your site's page load times and obviously lighten the download for your user. + +Use the tools suggested below to minify your files automatically before or during your build or your deployment. + +- [terser - JavaScript parser, mangler and compressor toolkit for ES6+](https://github.com/terser/terser) +- [uglify-js - npm](https://www.npmjs.com/package/uglify-js) +- [Online JavaScript Compressor](http://refresh-sf.com) +- [Short read: How is HTTP/2 different? Should we still minify and concatenate?](https://scaleyourcode.com/blog/article/28) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/minimize-http-requests.md b/src/best-practices/frontend-performance/content/minimize-http-requests.md index 791ad4481..de3aa7f35 100644 --- a/src/best-practices/frontend-performance/content/minimize-http-requests.md +++ b/src/best-practices/frontend-performance/content/minimize-http-requests.md @@ -1 +1,6 @@ -# Minimize http requests \ No newline at end of file +# Minimize HTTP Requests + +> Always ensure that every file requested are essential for your website or application. + +- [Combine external CSS](https://varvy.com/pagespeed/combine-external-css.html) +- [Combine external JavaScript](https://varvy.com/pagespeed/combine-external-javascript.html) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/page-load-time-below-3s.md b/src/best-practices/frontend-performance/content/page-load-time-below-3s.md index 928df8551..8f3de0c13 100644 --- a/src/best-practices/frontend-performance/content/page-load-time-below-3s.md +++ b/src/best-practices/frontend-performance/content/page-load-time-below-3s.md @@ -1 +1,10 @@ -# Page load time below 3s \ No newline at end of file +# Page Load Time +> Reduce as much as possible your page load times to quickly deliver your content to your users. + +Faster your website or app is, less you have probability of bounce increases, in other terms you have less chances to lose your user or future client. Enough researches on the subject prove that point. + +Use online tools like [Page Speed Insights](https://developers.google.com/speed/pagespeed/insights/) or [WebPageTest](https://www.webpagetest.org/) to analyze what could be slowing you down and use the Front-End Performance Checklist to improve your load times. + +- [Compare your mobile site speed](https://www.thinkwithgoogle.com/feature/mobile/) +- [Test Your Mobile Website Speed and Performance - Think With Google](https://testmysite.thinkwithgoogle.com/intl/en-us) +- [Average Page Load Times for 2018 - How does yours compare? - MachMetrics Speed Blog](https://www.machmetrics.com/speed-blog/average-page-load-times-websites-2018/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/page-speed-insights.md b/src/best-practices/frontend-performance/content/page-speed-insights.md index e90ff6134..5b3fbd219 100644 --- a/src/best-practices/frontend-performance/content/page-speed-insights.md +++ b/src/best-practices/frontend-performance/content/page-speed-insights.md @@ -1 +1,5 @@ -# Page speed insights \ No newline at end of file +# Page Speed Insights + +Page Speed Insights is a free tool from Google that analyzes the performance of a web page and provides suggestions for improvements. + +- [Page Speed Insights](https://pagespeed.web.dev/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/page-weight-below-1500.md b/src/best-practices/frontend-performance/content/page-weight-below-1500.md index 87d2ae9ff..5b17d15d4 100644 --- a/src/best-practices/frontend-performance/content/page-weight-below-1500.md +++ b/src/best-practices/frontend-performance/content/page-weight-below-1500.md @@ -1 +1,11 @@ -# Page weight below 1500 \ No newline at end of file +# Page weight below 1500 + +> Reduce the size of your page + resources as much as you can. + +Ideally you should try to target < 500 KB but the state of web shows that the median of Kilobytes is around 1500 KB (even on mobile). Depending on your target users, network connection, devices, it's important to reduce as much as possible your total Kilobytes to have the best user experience possible. + +All the listed best practices in this list will help you to reduce as much as possible your resources and your code. + +- [Page Weight](https://httparchive.org/reports/page-weight#bytesTotal) +- [What Does My Site Cost?](https://whatdoesmysitecost.com/) +- [web - Measure full page size in Chrome DevTools - Stack Overflow](https://stackoverflow.com/questions/38239980/measure-full-page-size-in-chrome-devtools) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/pre-load-urls-where-possible.md b/src/best-practices/frontend-performance/content/pre-load-urls-where-possible.md index d1eaaec0e..621aa6e25 100644 --- a/src/best-practices/frontend-performance/content/pre-load-urls-where-possible.md +++ b/src/best-practices/frontend-performance/content/pre-load-urls-where-possible.md @@ -1 +1,9 @@ -# Pre load urls where possible \ No newline at end of file +# Preload URLs + +> Popular browsers can use directive on `` tag and `"rel"` attribute with certain keywords to pre-load specific URLs + +Prefetching allows a browser to silently fetch the necessary resources needed to display content that a user might access in the near future. The browser is able to store these resources in its cache and speed up the way web pages load when they are using different domains for page resources. When a web page has finished loading and the idle time has passed, the browser begins downloading other resources. When a user go in a particular link (already prefetched), the content will be instantly served. + +- [What Is Prefetching and Why Use It](https://www.keycdn.com/support/prefetching) +- [Prefetching, preloading, prebrowsing](https://css-tricks.com/prefetching-preloading-prebrowsing/) +- [What is Preload, Prefetch, and Preconnect](https://www.keycdn.com/blog/resource-hints) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/prefer-vector-images.md b/src/best-practices/frontend-performance/content/prefer-vector-images.md index 4d47e563b..a0349e0c6 100644 --- a/src/best-practices/frontend-performance/content/prefer-vector-images.md +++ b/src/best-practices/frontend-performance/content/prefer-vector-images.md @@ -1 +1,5 @@ -# Prefer vector images \ No newline at end of file +# Prefer Vector Images + +> Prefer using vector image rather than bitmap images (when possible). + +Vector images (SVG) tend to be smaller than images and SVG's are responsive and scale perfectly. These images can be animated and modified by CSS. \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/prevent-flash-text.md b/src/best-practices/frontend-performance/content/prevent-flash-text.md index 8fff8ad15..a81aab89c 100644 --- a/src/best-practices/frontend-performance/content/prevent-flash-text.md +++ b/src/best-practices/frontend-performance/content/prevent-flash-text.md @@ -1 +1,6 @@ -# Prevent flash text \ No newline at end of file +# Prevent Flash Text + +> Avoid transparent text until the Webfont is loaded + +- [`font-display` for the Masses](https://css-tricks.com/font-display-masses/) +- [CSS font-display: The Future of Font Rendering on the Web](https://www.sitepoint.com/css-font-display-future-font-rendering-web/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/recommended-guides.md b/src/best-practices/frontend-performance/content/recommended-guides.md index ea59b4955..702c278bb 100644 --- a/src/best-practices/frontend-performance/content/recommended-guides.md +++ b/src/best-practices/frontend-performance/content/recommended-guides.md @@ -1 +1,90 @@ -# Recommended guides \ No newline at end of file +# Recommended Guides + +> Optimize the critical rendering path: + +* [Critical CSS? Not So Fast!](https://csswizardry.com/2022/09/critical-css-not-so-fast/) +* [Priority Hints - What Your Browser Doesn’t Know (Yet)](https://www.etsy.com/codeascraft/priority-hints-what-your-browser-doesnt-know-yet) +* [Optimizing resource loading with Priority Hints](https://web.dev/priority-hints/) +* [Chrome Resource Priorities and Scheduling](https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0gpwNFiEP4TZS-YLRp_RuMlc/edit?usp=sharing) +* [How To Optimize CSS for Peak Site Performance](https://kinsta.com/blog/optimize-css/) +* [Eliminate render blocking CSS to improve start render time](https://www.jeffreyknox.dev/blog/eliminate-render-blocking-css-to-improve-start-render-time/) +* [Small Bundles, Fast Pages: What To Do With Too Much JavaScript](https://calibreapp.com/blog/bundle-size-optimization) +* [How to Eliminate Render-Blocking Resources: a Deep Dive](https://sia.codes/posts/render-blocking-resources/) +* [The Critical Request: How to Prioritise Requests to Improve Speed](https://calibreapp.com/blog/critical-request) +* [How to Improve CSS Performance](https://calibreapp.com/blog/css-performance) +* [The Simplest Way to Load CSS Asynchronously](https://www.filamentgroup.com/lab/load-css-simpler/) +* [CSS audit](https://css-tricks.com/a-quick-css-audit-and-general-notes-about-design-systems/) +* [Measuring the Critical Rendering Path](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/measure-crp) +* [Inlining or Caching? Both Please!](https://www.filamentgroup.com/lab/inlining-cache.html) +* [CSS and Network Performance](https://csswizardry.com/2018/11/css-and-network-performance/) +* [Analyzing Critical Rendering Path Performance](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/analyzing-crp) +* [Front-End Performance Checklist](https://github.com/thedaviddias/Front-End-Performance-Checklist) +* [The PRPL Pattern](https://developers.google.com/web/fundamentals/performance/prpl-pattern/) +* [Now You See Me: How To Defer, Lazy-Load And Act With IntersectionObserver](https://www.smashingmagazine.com/2018/01/deferring-lazy-loading-intersection-observer-api/) +* [Optimising the front end for the browser](https://hackernoon.com/optimising-the-front-end-for-the-browser-f2f51a29c572) +* [Prefer DEFER Over ASYNC](https://calendar.perfplanet.com/2016/prefer-defer-over-async/) +* [A comprehensive guide to font loading strategies](https://www.zachleat.com/web/comprehensive-webfonts/) +* [Understanding the critical rendering path, rendering pages in 1 second](https://medium.com/@luisvieira_gmr/understanding-the-critical-rendering-path-rendering-pages-in-1-second-735c6e45b47a) +* [More Weight Doesn’t Mean More Wait](https://www.filamentgroup.com/lab/weight-wait.html) + +> JavaScript Rendering Performance + +* [Five Data-Loading Patterns To Boost Web Performance](https://www.smashingmagazine.com/2022/09/data-loading-patterns-improve-frontend-performance/) +* [Optimize long tasks](https://web.dev/optimize-long-tasks/) +* [The impact of removing jQuery on our web performance](https://insidegovuk.blog.gov.uk/2022/08/15/the-impact-of-removing-jquery-on-our-web-performance/) +* [Profiling & Optimizing the runtime performance with the DevTools Performance tab](iamtk.co/profiling-and-optimizing-the-runtime-performance-with-the-devtools-performance-tab) +* [Don't fight the browser preload scanner](https://web.dev/preload-scanner/) +* [The Web Performance impact of jQuery](https://twitter.com/TheRealNooshu/status/1509487050122276864) +* [Have Single-Page Apps Ruined the Web? | Transitional Apps](https://www.youtube.com/watch?v=860d8usGC0o) +* [Improve how you architect webapps](https://www.patterns.dev/) +* [Nuxt SSR Optimizing Tips](https://vueschool.io/articles/vuejs-tutorials/nuxt-ssr-optimizing-tips/, Filip Rakowski +* [GPU accelerated JavaScript](https://gpu.rocks/#/) +* [Introducing Partytown 🎉: Run Third-Party Scripts From a Web Worker](https://dev.to/adamdbradley/introducing-partytown-run-third-party-scripts-from-a-web-worker-2cnp) +* [Astro: Astro is a fresh but familiar approach to building websites. Astro combines decades of proven performance best practices with the DX improvements of the component-oriented era. Use your favorite JavaScript framework and automatically ship the bare-minimum amount of JavaScript—by default.](https://docs.astro.build/getting-started/) +* [Minimising Layout and Layout thrashing for 60 FPS](https://www.charistheo.io/blog/2021/09/dom-reflow-and-layout-thrashing/) +* [Does shadow DOM improve style performance?](https://nolanlawson.com/2021/08/15/does-shadow-dom-improve-style-performance/) +* [Debugging memory leaks - HTTP 203](https://www.youtube.com/watch?v=YDU_3WdfkxA) +* [Explore JavaScript Dependencies With Lighthouse Treemap](https://sia.codes/posts/lighthouse-treemap/) +* [The real cost of Javascript dependencies (and the state of JS package quality)](https://medium.com/voodoo-engineering/the-real-cost-of-javascript-dependencies-and-the-state-of-js-package-quality-a8dacd74c0ec) +* [The State Of Web Workers In 2021](https://www.smashingmagazine.com/2021/06/web-workers-2021/) +* [Techniques for developing high-performance animations](https://web.dev/animations/) +* [Building a Faster Web Experience with the postTask Scheduler](https://medium.com/airbnb-engineering/building-a-faster-web-experience-with-the-posttask-scheduler-276b83454e91), Callie (Airbnb Engineering & Data Science) +* [Don’t attach tooltips to document.body – Learn how the browser works – Debug forced reflow](https://atfzl.com/don-t-attach-tooltips-to-document-body) +* [How to Create and Fix Memory Leaks With Chrome DevTools](https://betterprogramming.pub/build-me-an-angular-app-with-memory-leaks-please-36302184e658) +* [JavaScript performance beyond bundle size](https://nolanlawson.com/2021/02/23/javascript-performance-beyond-bundle-size/) +* [The Import On Interaction Pattern](https://addyosmani.com/blog/import-on-interaction/) +* [The “Live DOM” Is Not “Slow”, “Bad”, Or “Wrong”. Web Developers Are.](https://levelup.gitconnected.com/the-live-dom-is-not-slow-bad-or-wrong-web-developers-are-2bf86c3b9e2e) +* [Prevent layout shifts with CSS grid stacks](https://www.hsablonniere.com/prevent-layout-shifts-with-css-grid-stacks--qcj5jo/) +* [content-visibility: the new CSS property that boosts your rendering performance](https://web.dev/content-visibility/) +* [Preact vs React - Updating React at Etsy](https://github.com/mq2thez/blog/blob/main/upgrade-react-etsy/preact-vs-react.md) +* [The Cost of Javascript Frameworks](https://timkadlec.com/remembers/2020-04-21-the-cost-of-javascript-frameworks/) +* [Fixing memory leaks in web applications](https://nolanlawson.com/2020/02/19/fixing-memory-leaks-in-web-applications/) +* [How to load polyfills only when needed](https://3perf.com/blog/polyfills/) +* [Responsible JavaScript: Part III - Third parties](https://alistapart.com/article/responsible-javascript-part-3/) +* [The cost of JavaScript in 2019](https://v8.dev/blog/cost-of-javascript-2019) +* [When should you be using Web Workers?](https://dassur.ma/things/when-workers/) +* [Responsible Javascript: Part II - Code Bundle](https://alistapart.com/article/responsible-javascript-part-2/) +* [Faster script loading with BinaryAST?](https://blog.cloudflare.com/binary-ast/) +* [Svelte 3: Rethinking reactivity](https://svelte.dev/blog/svelte-3-rethinking-reactivity) +* [Responsible Javascript: Part I - Web platform over frameworks](https://alistapart.com/article/responsible-javascript-part-1/) +* [JavaScript Loading Priorities in Chrome](https://addyosmani.com/blog/script-priorities/) +* [Idle Until Urgent](https://philipwalton.com/articles/idle-until-urgent/) +* [Browser painting and considerations for web performance](https://css-tricks.com/browser-painting-and-considerations-for-web-performance/) +* [The Cost Of JavaScript In 2018](https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4) ([Video](https://www.youtube.com/watch?v=i5R7giitymk)) +* [Examining Web Worker Performance](https://www.loxodrome.io/post/web-worker-performance/) +* [Front-End Performance Checklist](https://github.com/thedaviddias/Front-End-Performance-Checklist) +* [jankfree](http://jankfree.org/) +* [What forces layout/reflow?](https://gist.github.com/paulirish/5d52fb081b3570c81e3a) +* [Using requestIdleCallback](https://developers.google.com/web/updates/2015/08/using-requestidlecallback) +* [Optimize Javascript Execution](https://developers.google.com/web/fundamentals/performance/rendering/optimize-javascript-execution) +* [Why Web Developers Need to Care about Interactivity](https://philipwalton.com/articles/why-web-developers-need-to-care-about-interactivity/) +* [Improving Performance with the Paint Timing API](https://www.sitepen.com/blog/2017/10/06/improving-performance-with-the-paint-timing-api) +* [Deploying ES2015+ Code in Production Today](https://philipwalton.com/articles/deploying-es2015-code-in-production-today/) +* [Performant Web Animations and Interactions: Achieving 60 FPS](https://blog.algolia.com/performant-web-animations/) +* [JavaScript Start-up Performance](https://medium.com/reloading/javascript-start-up-performance-69200f43b201) +* [Performant Parallaxing](https://developers.google.com/web/updates/2016/12/performant-parallaxing) +* [The Anatomy of a Frame](https://aerotwist.com/blog/the-anatomy-of-a-frame/) +* [The future of loading CSS](https://jakearchibald.com/2016/link-in-body/) +* [4 Types of Memory Leaks in JavaScript and How to Get Rid Of Them](https://auth0.com/blog/four-types-of-leaks-in-your-javascript-code-and-how-to-get-rid-of-them/) +* [The cost of frameworks](https://aerotwist.com/blog/the-cost-of-frameworks/) +* [FLIP Your Animations](https://aerotwist.com/blog/flip-your-animations/) diff --git a/src/best-practices/frontend-performance/content/remove-unused-css.md b/src/best-practices/frontend-performance/content/remove-unused-css.md index 1143cc8c0..51e88d3da 100644 --- a/src/best-practices/frontend-performance/content/remove-unused-css.md +++ b/src/best-practices/frontend-performance/content/remove-unused-css.md @@ -1 +1,10 @@ -# Remove unused css \ No newline at end of file +# Remove Unused CSS + +Removing unused CSS selectors can reduce the size of your files and then speed up the load of your assets. + +Always check if the framework CSS you want to use don't already has a reset / normalize code included. Sometimes you may not need everything that is inside your reset / normalize file. + +- [UnCSS Online](https://uncss-online.com/) +- [PurifyCSS](https://github.com/purifycss/purifycss) +- [PurgeCSS](https://github.com/FullHuman/purgecss) +- [Chrome DevTools Coverage](https://developers.google.com/web/updates/2017/04/devtools-release-notes#coverage) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/serve-exact-size-images.md b/src/best-practices/frontend-performance/content/serve-exact-size-images.md index 0880a9109..3c4d38f80 100644 --- a/src/best-practices/frontend-performance/content/serve-exact-size-images.md +++ b/src/best-practices/frontend-performance/content/serve-exact-size-images.md @@ -1 +1,10 @@ -# Serve exact size images \ No newline at end of file +# Responsive Images + +> Ensure to serve images that are close to your display size. + +Small devices don't need images bigger than their viewport. It's recommended to have multiple versions of one image on different sizes. + +- Create different image sizes for the devices you want to target +- Use `srcset` and `picture` to deliver multiple variants of each image. + +- [Responsive images - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/set-width-height-images.md b/src/best-practices/frontend-performance/content/set-width-height-images.md index 070af0ccc..665f81445 100644 --- a/src/best-practices/frontend-performance/content/set-width-height-images.md +++ b/src/best-practices/frontend-performance/content/set-width-height-images.md @@ -1 +1,5 @@ -# Set width height images \ No newline at end of file +# Image Dimensions + +> Set width and height attributes on `` if the final rendered image size is known. + +If height and width are set, the space required for the image is reserved when the page is loaded. However, without these attributes, the browser does not know the size of the image, and cannot reserve the appropriate space to it. The effect will be that the page layout will change during loading (while the images load). \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/squoosh-ap.md b/src/best-practices/frontend-performance/content/squoosh-ap.md index 8603e8cb9..090f2eadc 100644 --- a/src/best-practices/frontend-performance/content/squoosh-ap.md +++ b/src/best-practices/frontend-performance/content/squoosh-ap.md @@ -1 +1,5 @@ -# Squoosh ap \ No newline at end of file +# Squoosh.app + +Squoosh.app is a web app that allows you to compress images using a variety of codecs. It is built by Google Chrome team and is open source. + +- [Squoosh.app](https://squoosh.app/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/use-cdn.md b/src/best-practices/frontend-performance/content/use-cdn.md index 7457594a1..1964eeda9 100644 --- a/src/best-practices/frontend-performance/content/use-cdn.md +++ b/src/best-practices/frontend-performance/content/use-cdn.md @@ -1 +1,6 @@ -# Use cdn \ No newline at end of file +# Use CDN + +Use a CDN to serve your static assets. This will reduce the load on your server and improve the performance of your site. + + - [10 Tips to Optimize CDN Performance - CDN Planet](https://www.cdnplanet.com/blog/10-tips-optimize-cdn-performance/) + - [HTTP Caching | Web Fundamentals | Google Developers](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/use-http-cache-headers.md b/src/best-practices/frontend-performance/content/use-http-cache-headers.md index ab3b30f5f..8de08e409 100644 --- a/src/best-practices/frontend-performance/content/use-http-cache-headers.md +++ b/src/best-practices/frontend-performance/content/use-http-cache-headers.md @@ -1 +1,5 @@ -# Use http cache headers \ No newline at end of file +# HTTP Caching + +Set HTTP headers to avoid expensive number of roundtrips between your browser and the server. + +- [Using cache-control for browser caching](https://varvy.com/pagespeed/cache-control.html) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/use-https-on-your-website.md b/src/best-practices/frontend-performance/content/use-https-on-your-website.md index ac97816b3..83b935a29 100644 --- a/src/best-practices/frontend-performance/content/use-https-on-your-website.md +++ b/src/best-practices/frontend-performance/content/use-https-on-your-website.md @@ -1 +1,9 @@ -# Use https on your website \ No newline at end of file +# Use HTTPs + +HTTPS is not only for ecommerce websites, but for all websites that are exchanging data. Data shared by a user or data shared to an external entity. Modern browsers today limit functionalities for sites that are not secure. For example: geolocation, push notifications and service workers don't work if your instance is not using HTTPS. And today is much more easy to setup a project with an SSL certificate than it was before (and for free, thanks to Let's Encrypt). + +- [Why Use HTTPS? | Cloudflare](https://www.cloudflare.com/learning/security/why-use-https/) +- [Enabling HTTPS Without Sacrificing Your Web Performance - Moz](https://moz.com/blog/enabling-https-without-sacrificing-web-performance) +- [How HTTPS Affects Website Performance](https://wp-rocket.me/blog/https-affects-website-performance/) +- [HTTP versus HTTPS versus HTTP2 - The real story | Tune The Web](https://www.tunetheweb.com/blog/http-versus-https-versus-http2/) +- [HTTP vs HTTPS — Test them both yourself](https://www.httpvshttps.com/) \ No newline at end of file diff --git a/src/best-practices/frontend-performance/content/use-non-blocking-javascript.md b/src/best-practices/frontend-performance/content/use-non-blocking-javascript.md index 2699202db..a24df202f 100644 --- a/src/best-practices/frontend-performance/content/use-non-blocking-javascript.md +++ b/src/best-practices/frontend-performance/content/use-non-blocking-javascript.md @@ -1 +1,20 @@ -# Use non blocking javascript \ No newline at end of file +# Non-Blocking JavaScript + +JavaScript files are loaded asynchronously using async or deferred using defer attribute. + +```javascript + + + + + +``` + +JavaScript blocks the normal parsing of the HTML document, so when the parser reaches a `