Few tips to improve WebPage Performance

Points to be considered while optimizing the performance of a webpage:

Images Optimisation
Fonts Optimisation
Optimizing CSS and JS

Image Optimisation

Choose the Right File Format (PNG, JPG, Webp, SVG, etc.)
Compress the image…


This content originally appeared on DEV Community and was authored by Vamsi Tallam

Points to be considered while optimizing the performance of a webpage:

  • Images Optimisation
  • Fonts Optimisation
  • Optimizing CSS and JS

Image Optimisation

  • Choose the Right File Format (PNG, JPG, Webp, SVG, etc.)
  • Compress the image appropriately
  • Use appropriate dimensions for the image, also specify height and width attributes for the image
  • Use Lazy loading for below-the-fold images. (You can use different 3rd party libraries like Unveil, lazysizes, etc.)

To achieve the above steps(except lazyloading) you can use the Cloudinary service. It will automatically serve the right file format and compress the image and serve the right quality based on the device.

Fonts Optimisation

  • Use woff2 file format.
  • Use font display swap CSS property in the font face to ensure that fonts remain visible while the fonts get downloaded
  • Import only required fonts.
  • preconnect the font domain

<link rel="preconnect" href="https://fonts.googleapis.com">

  • preload the fonts as style as shown below:

<link rel="preload" href="https://use.typekit.net/gwu7gbd.css" as="style" onload="this.onload=null;this.rel='stylesheet'" />

  • Use only the required glyphs while loading the fonts. For example, I am using only alphabets on my website, then I can load the fonts as shown below:

https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap&text=ABCBEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqurstuvwxyz

  • It's better to use the required Unicodes only while loading the fonts.

For more details on best practices, visit this web.dev artcile

Optimizing CSS

  • Remove Unused CSS. You can refer to this article to know about the tools that can be helpful for removing unused CSS,
  • Extract Critical CSS and inline the crititical CSS inside the <head> tag. Refer to this article to know about the tools that help you to identify the critcial CSS.
  • Defer the Non Critical CSS. Refer to this article to know how to defer the unused CSS.

Optimizing JS

  • Defer unused JavaScript

    • Code-split your bundle into multiple chunks
    • Defer any non-critical JavaScript, including third-party scripts, using async or defer
  • Minimize unused polyfills

  • Use a web worker

  • For More details on optimizing JS, you can refer to this article.


This content originally appeared on DEV Community and was authored by Vamsi Tallam


Print Share Comment Cite Upload Translate Updates
APA

Vamsi Tallam | Sciencx (2021-09-11T16:38:07+00:00) Few tips to improve WebPage Performance. Retrieved from https://www.scien.cx/2021/09/11/few-tips-to-improve-webpage-performance/

MLA
" » Few tips to improve WebPage Performance." Vamsi Tallam | Sciencx - Saturday September 11, 2021, https://www.scien.cx/2021/09/11/few-tips-to-improve-webpage-performance/
HARVARD
Vamsi Tallam | Sciencx Saturday September 11, 2021 » Few tips to improve WebPage Performance., viewed ,<https://www.scien.cx/2021/09/11/few-tips-to-improve-webpage-performance/>
VANCOUVER
Vamsi Tallam | Sciencx - » Few tips to improve WebPage Performance. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/11/few-tips-to-improve-webpage-performance/
CHICAGO
" » Few tips to improve WebPage Performance." Vamsi Tallam | Sciencx - Accessed . https://www.scien.cx/2021/09/11/few-tips-to-improve-webpage-performance/
IEEE
" » Few tips to improve WebPage Performance." Vamsi Tallam | Sciencx [Online]. Available: https://www.scien.cx/2021/09/11/few-tips-to-improve-webpage-performance/. [Accessed: ]
rf:citation
» Few tips to improve WebPage Performance | Vamsi Tallam | Sciencx | https://www.scien.cx/2021/09/11/few-tips-to-improve-webpage-performance/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.