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

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024
  • 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/g...
    FREE $100 credit @Digital Ocean: m.do.co/c/3208...
    Subscribe: www.youtube.co...
    Support the channel:
    Paypal: www.paypal.me/...
    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

ความคิดเห็น • 60

  • @rightangleoverseas2391
    @rightangleoverseas2391 3 ปีที่แล้ว +17

    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 !

    • @mafiacodes
      @mafiacodes  3 ปีที่แล้ว +6

      Thank you so much ☺️, spread the word/work. Subscribe like share

    • @rightangleoverseas2391
      @rightangleoverseas2391 3 ปีที่แล้ว +1

      @@mafiacodes Most certainly, thank you

    • @AvinashKumar-jo8ql
      @AvinashKumar-jo8ql 3 ปีที่แล้ว +2

      Agree. He is sharing premium content.

  • @andersondantas2010
    @andersondantas2010 3 ปีที่แล้ว +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 ปีที่แล้ว +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 11 หลายเดือนก่อน

      @@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 4 ปีที่แล้ว +3

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

  • @smnomad9276
    @smnomad9276 2 ปีที่แล้ว +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 3 ปีที่แล้ว +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 😁

    • @mafiacodes
      @mafiacodes  3 ปีที่แล้ว +1

      Thanks for the compliments

  • @ramiworkstation
    @ramiworkstation 2 หลายเดือนก่อน

    Thank you thousand times ❤️

  • @raymondmichael4987
    @raymondmichael4987 4 ปีที่แล้ว +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

  • @AvinashKumar-jo8ql
    @AvinashKumar-jo8ql 3 ปีที่แล้ว +4

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

  • @Tony.Nguyen137
    @Tony.Nguyen137 8 หลายเดือนก่อน +1

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

  • @sangeetashetty8542
    @sangeetashetty8542 ปีที่แล้ว

    Helpfull content. Clear Explaination

  • @Tony.Nguyen137
    @Tony.Nguyen137 8 หลายเดือนก่อน

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

  • @AKASH-sw9bs
    @AKASH-sw9bs ปีที่แล้ว +1

    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.

  • @ivan86478
    @ivan86478 ปีที่แล้ว

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

  • @botbot533
    @botbot533 2 ปีที่แล้ว

    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.

  • @GabrielMartinez-ez9ue
    @GabrielMartinez-ez9ue 3 ปีที่แล้ว +1

    Thank you!

  • @ramonpaolomaran2253
    @ramonpaolomaran2253 2 ปีที่แล้ว +1

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

    • @saisankarmadeti4736
      @saisankarmadeti4736 2 หลายเดือนก่อน

      The same is happening with me, you got any solution?

  • @koora-gool03
    @koora-gool03 2 ปีที่แล้ว

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

  • @chandannelson
    @chandannelson ปีที่แล้ว +2

    Nice

  • @arinzechukwuhillary0zor644
    @arinzechukwuhillary0zor644 2 ปีที่แล้ว

    please can you do that of react js

  • @pratika-prakhar
    @pratika-prakhar 2 ปีที่แล้ว +1

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

    • @hardikmistry1661
      @hardikmistry1661 2 ปีที่แล้ว

      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 ปีที่แล้ว +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

  • @AnandGiri
    @AnandGiri 2 ปีที่แล้ว

    good job

  • @technoinfoworldwide2329
    @technoinfoworldwide2329 4 ปีที่แล้ว +1

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

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว +1

      its an emoji, u can add that using the keyboard

    • @amanali9501
      @amanali9501 4 ปีที่แล้ว +1

      It's not working in windows CMD or prayer

    • @amanali9501
      @amanali9501 4 ปีที่แล้ว

      Or powershell

  • @shivpratap5183
    @shivpratap5183 3 ปีที่แล้ว

    thanks bro.

  • @sidharthbhunia2026
    @sidharthbhunia2026 4 ปีที่แล้ว +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  4 ปีที่แล้ว +1

      Try hard refresh and see if it work’s

    • @sidharthbhunia2026
      @sidharthbhunia2026 4 ปีที่แล้ว +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 2 ปีที่แล้ว

      @@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.

  • @gmmkeshav
    @gmmkeshav ปีที่แล้ว

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

  • @emeetv
    @emeetv 4 ปีที่แล้ว

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

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว +3

      Not at all u can use it 💯

    • @emeetv
      @emeetv 4 ปีที่แล้ว +1

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

  • @amanali9501
    @amanali9501 4 ปีที่แล้ว

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

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว

      Vscode extension: import cost

  • @balajih2214
    @balajih2214 4 ปีที่แล้ว

    Is image quality will reduce when use this dependency

  • @mo_i_nas
    @mo_i_nas หลายเดือนก่อน

    It's to 200x faster, it's 200x less data. Not the same thing. In fact, you see that it only saved you about 25% load time.

  • @vijayarajan-bt5fk
    @vijayarajan-bt5fk ปีที่แล้ว

    Woooooooww

  • @sidharthbhunia2026
    @sidharthbhunia2026 4 ปีที่แล้ว +1

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

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว +2

      Force refresh the page-shift + reload

    • @sidharthbhunia2026
      @sidharthbhunia2026 4 ปีที่แล้ว

      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 4 ปีที่แล้ว

      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 3 ปีที่แล้ว

    HoW To mAkE ApP SuPeR FaST!!!