How to use compression in Nodejs to make it faster and smaller by at least 10 times.

Sdílet
Vložit
  • čas přidán 30. 08. 2020
  • In this video you will learn how to make a #nodejs #express application fast by using #gzip #compression in responses.
    ⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for 6 months and I love it! www.kite.com/get-kite/?...
    FREE $100 credit @Digital Ocean: m.do.co/c/3208f08b3324
    Subscribe: czcams.com/users/yourstruly2...
    Support the channel:
    Paypal: www.paypal.me/trulymittal
    Patreon: / trulymittal
    ---------------
    Other useful Playlists
    ---------------
    #RestAPI (#NodeJS and MongoDB): • REST API using NodeJS ...
    #API Authentication using #JWT: • NodeJS API Authenticat...
    #Firebase: • Firebase | Build a Not...
    Docker: • Docker
    MongoDB: • Learn MongoDB in 50 mi...
    Html/Css/Js: • HTML / CSS / JS
    Android: • Android
    Challenges: • Challenges
    ---------------
    What I use
    ---------------
    Mouse: amzn.to/2O9RJtu
    Keyboard: amzn.to/2qxajCU
    Keyboard 2: amzn.to/2XDWH4X
    Monitor: amzn.to/2pDg7dH
    Processor: amzn.to/347WWIb
    RAM: amzn.to/2QEkUqw
    Graphics: amzn.to/33aBrF4
    Microphone: amzn.to/2DabdI9
    #StayHome #WithMe #yoursTRULY #tutorial #howto #android

Komentáře • 57

  • @rightangleoverseas2391
    @rightangleoverseas2391 Před 2 lety +15

    Can't thank you enough for all the production grade development knowledge that you're sharing with us. Every developer should watch this. Your channel is so underrated. Thank you !

  • @andersondantas2010
    @andersondantas2010 Před 2 lety +24

    Just keep in mind that real-life data might not be a string repeated 1000 times which will result in you having a result not as good as those from the video. Although, it is really useful and can speed up your web pages, you may get about 2 to 10 times compression from real HTML/CSS/JSON and any other text format instead of the 100s of times from the video.

    • @nexgenua
      @nexgenua Před 9 měsíci +2

      Also, if the data is large and there are a lot of requests, it can lead to blocking of the thread, as javascript is single-threaded

    • @sebastianjulonchamana2987
      @sebastianjulonchamana2987 Před 7 měsíci

      @@nexgenua basically you need a lot of memory to handle it, for the server we're using is working from 128mb request to 3.9mb that's actually savage

  • @tambolaking5383
    @tambolaking5383 Před 3 lety +3

    Superb video. Love such useful and less explored content. Improves my development so much.

  • @smnomad9276
    @smnomad9276 Před 2 lety +4

    Just discovered your channel and your programming level is one of the highest on youtube 🔥 Please keep posting more videos you deserve 100k followers at least ❤️ Can you please do a video on Node js multithreading and worker threads, and how we can combine them with javascript web workers + this compression method to give us the lightest and fastest node js app possible ?? I think that video would make a lot of noise in the javascript community making nodejs as fast as Go for example for backend or faster!

  • @ahlambeyoud1709
    @ahlambeyoud1709 Před 3 lety +4

    Thank you very much, you are truly one of the best programmer youtubers 👍 I have learned so much from your channel, very clear explanation, keep up your great work 😁

  • @sangeetashetty8542
    @sangeetashetty8542 Před rokem

    Helpfull content. Clear Explaination

  • @GabrielMartinez-ez9ue
    @GabrielMartinez-ez9ue Před 3 lety +1

    Thank you!

  • @AvinashKumar-jo8ql
    @AvinashKumar-jo8ql Před 2 lety +4

    Any reference for media(audio/video/image) compression on client-side in react js would be helpful.

  • @raymondmichael4987
    @raymondmichael4987 Před 3 lety +2

    These short videos are really great brother.
    Can you explain how to first download image in low quality when page during low network, and download full image later

  • @AnandGiri
    @AnandGiri Před 2 lety

    good job

  • @shivpratap5183
    @shivpratap5183 Před 2 lety

    thanks bro.

  • @chandannelson
    @chandannelson Před rokem +2

    Nice

  • @ivan86478
    @ivan86478 Před rokem

    Do hoy know how to import if imán using type module on json configuration ?

  • @botbot533
    @botbot533 Před 2 lety

    Can we use it for request header as well? In my case, on localhost it works, but once deployed to ingress, it throws 431. I use a large string in request header.

  • @arinzechukwuhillary0zor644

    please can you do that of react js

  • @koora-gool03
    @koora-gool03 Před 2 lety

    Hi sir i need your help to dycrpted content for a link please can you?

  • @Tony.Nguyen137
    @Tony.Nguyen137 Před 4 měsíci

    @2:47 where does the red text “269,6k (gzipped: 62,9k)” comes from??

  • @Tony.Nguyen137
    @Tony.Nguyen137 Před 4 měsíci

    Normally I send a html template with css js file in the response, will the html js css files be compressed?

  • @ramonpaolomaran2253
    @ramonpaolomaran2253 Před 2 lety

    compression is not working in my project
    I not see its working... I have the same size in front-end response using express.js : (

  • @emeetv
    @emeetv Před 3 lety

    Is there any disadvantages of using this?
    Or will it be OK to use it on production

    • @mafiacodes
      @mafiacodes  Před 3 lety +3

      Not at all u can use it 💯

    • @emeetv
      @emeetv Před 3 lety +1

      @@mafiacodes thank you so much.. Appreciate your kind work.. Hope you upload such a good content frequently. Well wishes

  • @technoinfoworldwide2329
    @technoinfoworldwide2329 Před 3 lety +1

    how did you use rocket symbol in console.log()?

    • @mafiacodes
      @mafiacodes  Před 3 lety +1

      its an emoji, u can add that using the keyboard

    • @amanali9501
      @amanali9501 Před 3 lety +1

      It's not working in windows CMD or prayer

    • @amanali9501
      @amanali9501 Před 3 lety

      Or powershell

  • @pratika-prakhar
    @pratika-prakhar Před 2 lety +1

    If we use compression then what about response time, will it reduce the performance?

    • @hardikmistry1661
      @hardikmistry1661 Před 2 lety

      no may be if you use google developer speed test they will tell you to do compresion on text base data sending so that mean crome browser decrypt by it self as gzip. it is made by headers present in responce.

    • @nexgenua
      @nexgenua Před 9 měsíci +1

      @@hardikmistry1661 He meant that the server, archiving data, spends a lot of resources and at this time will not be able to serve other requests

  • @sidharthbhunia2026
    @sidharthbhunia2026 Před 3 lety +1

    Hie sir please reply I tried this thing with static files like photo I stored them in public directory and then made express static as middleware
    The thing is that I checked with postman that those static files don't have that content encoding gzip
    Also on browser the transfer size is same
    Please reply sir thanku in advance

    • @mafiacodes
      @mafiacodes  Před 3 lety +1

      Try hard refresh and see if it work’s

    • @sidharthbhunia2026
      @sidharthbhunia2026 Před 3 lety +1

      No sir in web browser when I send any text kinda thing that u have show its working perfectly no problem there but when I am accessing a static file like making a directory public and then using express making it public now when I use that link for suppose a picture it's coming but the transfer size and actual size is same(using Mozilla browser) and when I watched the response header it didn't have that content encoding as gzip
      Sir I tried stack over flow and Google out stuffs but I didn't found anything please once u try that thing please sir
      Edit:- even for json data it is working awesome sir the thing is static files sir

    • @hardikmistry1661
      @hardikmistry1661 Před 2 lety

      @@sidharthbhunia2026 gzip and other compresion are work on text base data sharing.
      you can see that by using google developer speed test runner they say you have to do it for text base data sharing.
      i also have same question like you have made this comment 1 year so share with me please if you have find some other way to compress image and media type data. thans in advance.

  • @balajih2214
    @balajih2214 Před 3 lety

    Is image quality will reduce when use this dependency

  • @AKASH-sw9bs
    @AKASH-sw9bs Před rokem

    Brother this doesn't work good with JSON format (230kb is compressed down to 219kb only) . The only solution i think i will go with is grpc for saving bandwidth in my future projects.

  • @amanali9501
    @amanali9501 Před 3 lety

    How to getting that comment type near required comprehensive i.e. 62.45kb

  • @vijayarajan-bt5fk
    @vijayarajan-bt5fk Před rokem

    Woooooooww

  • @gmmkeshav
    @gmmkeshav Před rokem

    How the hell there is no difference in viewing after compression.

  • @sidharthbhunia2026
    @sidharthbhunia2026 Před 3 lety +1

    In my case I didn't saw any difference in size even after using compression ,,🤔

    • @mafiacodes
      @mafiacodes  Před 3 lety +2

      Force refresh the page-shift + reload

    • @sidharthbhunia2026
      @sidharthbhunia2026 Před 3 lety

      Hey I am using Firefox browser n I noticed that transfer is getting reduced if I use compression n not the size I got it 🤙🤗 thanku for the tutorial bruh 🤘

    • @sidharthbhunia2026
      @sidharthbhunia2026 Před 3 lety

      And another help bruh , please make a video on async task loader in android please as async task have been deprecated ,soo I want to use async task loader please it will be a great help

  • @tabaxaddhbi6635
    @tabaxaddhbi6635 Před 3 lety

    HoW To mAkE ApP SuPeR FaST!!!