Coder Social home page Coder Social logo

timonwa / using-blurdataurl-in-nextjs Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 4.0 3.91 MB

Improving Next.js app performance with BlurHash

Home Page: https://using-blur-data-url-in-next-js.vercel.app

License: MIT License

JavaScript 86.43% CSS 13.57%
article-publisher article-writing blurhash data-url image-optimization nextjs performance-tools reactjs blur-image next-image

using-blurdataurl-in-nextjs's Introduction

Using blurDataURL in NextJs. ✍️

This is the code example for my article on Improving Next.js app performance with BlurHash for LogRocket. Here is the live demo.

Visit my blog, Timonwa's Notes, for awesome technical content like articles, code snippets, tech goodies, community projects, and more.

Summary

Next.js is a flexible React framework that can be used to build fast web applications. We can use the Next.js configuration to create, develop, and ship products fast without spending days structuring the application. But, building a web app quickly and creating a fast-loading web app are two different things.

The time it takes a web app to load to the client depends on how long it takes to serve its application code, styles, and data to the client in the first initial load. For example, the application’s performance degrades if the server needs to send additional assets, such as images, during the first initial load.

There are numerous ways to optimize or improve the performance of your Next.js app to achieve a faster loading time. We’ll focus on one of these optimization strategies: using image placeholders for image optimization. Specifically, creatng image placeholders using the BlurHash algorithm.

Breakdown

  • What is an image placeholder?
  • What is BlurHash?
  • How does BlurHash work?
  • How much does BlurHash impact page speed?
  • How do you implement BlurHash in a Next.js app?
  • Generating BlurHash placeholders for static images
  • Generating BlurHash placeholders for dynamic images
  • Converting a Base83 data URL to a Base64 data URL
  • Adding the BlurHash URL to a Next.js app

Please give this repo a ⭐ if it was helpful to you.

demo preview video

using-blurdataurl-in-nextjs's People

Contributors

timonwa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.