Varnish - HTTP Accelerator Crash Course

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

Комментарии • 49

  • @hnasr
    @hnasr  4 года назад +20

    Classic HTTP Architecture : 1:53
    How Varnish Works 3:50
    Demo HTTP 7:50
    Demo HTTPS 18:23
    Varnish Pros 28:43
    Varnish Cons 39:26

  • @arvidmildner6274
    @arvidmildner6274 3 года назад +7

    Just sharing some problems I ran into when doing this guide: If you run into "Error 503 Backend fetch failed" all the time, it may be because varnish cannot find your services that your run on localhost. If you are on Mac (may work on other OS too), you will have to type the following to connect to a service running on your own machine outside docker (where host.docker.interal will resolve to to where docker thinks your local machine is relative to its own network):
    backend default {
    .host = "host.docker.internal";
    .port = "3007";
    }
    This took me a long time to figure out so wanted to share it.
    Also, if you run into problems with the caching not working, make sure you are not sending cookies or setting no-cache headers in the request as this makes varnish not cache by default.
    Otherwise, thanks for a good video Hussein!

    • @martintopolanek448
      @martintopolanek448 7 месяцев назад +1

      Thank you! You directed me to the right solution! I had to change port because my next.js app is by default launched on port 3000. So I needed to have following configuration:
      backend default {
      .host = "host.docker.internal";
      .port = "3000";
      }

  • @0xedb
    @0xedb 4 года назад +7

    gets so happy: "I can refresh all day"

  • @robertcarlsson1781
    @robertcarlsson1781 4 года назад +2

    Incredibly good beginners guide to Varnish. Great balance between basic and more advanced stuff. Thanks alot!

    • @hnasr
      @hnasr  4 года назад +2

      Robert Carlsson thanks Robert! Appreciate you

  • @DamianMajewski
    @DamianMajewski 2 года назад

    I really like the way you talk about this stuff ;)

  • @WilliamWolfrath
    @WilliamWolfrath 3 года назад

    Only watched one video of yours so far but you're fantastic. Gonna check out more!

  • @iQatif
    @iQatif 3 года назад

    Bro Hussain, first of all, I would like to thank you for your efforts and the time you've spent to come out with this masterpiece channel.
    great job, it was very helpful indeed.
    Q) Don't you think that when we used different technologies from different authors working very similar things will cause data delay?
    speed is one of the important factors.
    I think one technology will achieve 4 tasks in 1 environment, for example, we can use Nginx to listen to port 80 and/or 443 terminations in the frontend as well as a load balancer + Caching in the backend.
    please correct me if I am wrong.
    Regards

  • @ryanisthewind
    @ryanisthewind 2 года назад

    Teaching is an Art, and you dear sir, you are an ARTIST!

  • @abdallahdhaou3065
    @abdallahdhaou3065 4 года назад +3

    Perfect 👍👍👍 god bless you 🙏

    • @hnasr
      @hnasr  4 года назад

      Thanks Abdalla!

  • @joelachiana9912
    @joelachiana9912 Год назад

    This is excellent sir

  • @palaniappanrm6277
    @palaniappanrm6277 4 года назад +2

    Great video, but personally I will go with Redis to have greater control as you said and by avoiding an extra hop for all the requests.

  • @zsebacsi2
    @zsebacsi2 Год назад

    What happened before 17:45 so that the timestamp changed with varnish too?

  • @webdev723
    @webdev723 3 года назад

    I am proud of you son.

  • @whereismypipey
    @whereismypipey 4 года назад +1

    Today I learned ❤❤❤

  • @markrawson1435
    @markrawson1435 Год назад

    great video Hussein. Any idea what this would look like if we have four of the main web servers with an azure load balancer. Where does the varnish go into that design?

    • @pandaarmy9782
      @pandaarmy9782 7 месяцев назад

      Behind your loadbalancer would make the most sense, the LB can handle ssl termination and then forward requests to varnish, if you would use HAProxy as LB you would be able to do some really advanced stuff together with Varnish

  • @adamcheung1232
    @adamcheung1232 3 года назад

    Awesome awesome stuff. Amazing teacher you are Hussein

  • @jessebaker2861
    @jessebaker2861 4 года назад +1

    Great video

  • @ddrci88
    @ddrci88 2 года назад

    Can you please make varnish -> nginx -> Apache configuration ? Thanks

  • @robertosoriano9617
    @robertosoriano9617 3 года назад

    Thank you! Do you know how this could be combined with jwilder/nginx-proxy? I get a 503 error when I reach my server since Im using jwilder. Help would be greatly appreciated.

  • @yoonssam_kr
    @yoonssam_kr 3 года назад

    I am running a website on HTTP/2, was thinking of installing Varnish and came across your video.
    Just curious a bit further on the CONS site.. so if the server runs on HTTP/2, varnish has no benefit?

  • @stadtner
    @stadtner 2 года назад

    Danke!

  • @anirbandutta1371
    @anirbandutta1371 4 года назад +1

    Really helpful ..thanks

  • @sarojakuncha6487
    @sarojakuncha6487 4 года назад

    Hussein thanks for this tutorial it was helpful. Is there any way to trace varnish logs?

  • @rahulkumarsingh1716
    @rahulkumarsingh1716 4 года назад

    finally u did it

    • @hnasr
      @hnasr  4 года назад

      Yes! you are one of the people who requested this video ALOT.. enjoy!

    • @rahulkumarsingh1716
      @rahulkumarsingh1716 4 года назад

      @@hnasr what would be next video about? and when?

    • @hnasr
      @hnasr  4 года назад +1

      rahul kumar singh there is a video that went out today about spinning lightweight container that run Javascript code. Tomorrow’s video VPN vs Proxy

  • @marfnl2
    @marfnl2 4 года назад +1

    Do you need Varnish if you have a configured CDN?

    • @hnasr
      @hnasr  4 года назад +2

      If the CDN does caching for you (which probably they do) then I think you don’t need it necessarily

  • @Kavinnathcse
    @Kavinnathcse Год назад

    Can we use Varnish as cache proxy as frontend for docker registry? Hope varnish can cache docker images? If yes, is it feasible solution?

  • @workshop1804
    @workshop1804 3 года назад +1

    watch this in at least x1.5 for a better experience

  • @wesleydevries7415
    @wesleydevries7415 4 года назад

    Hey Hussein, do you recommend to use Apache + varnish or Apache + cloudflare?

    • @hnasr
      @hnasr  4 года назад +1

      Hey Wesley, I don’t have a strong opinion it depends on how much fine control you want. Cloudflare will take care of a lot of caching and optimization for you that You will have to manage manually with Varnish.
      Varnish will give you control and customization through VCL.
      One option is cheaper than the other

    • @wesleydevries7415
      @wesleydevries7415 4 года назад

      @@hnasr thank you a lot Hussein, my hoster for my shared hosting WordPress website has a special "WordPress" varnish settings and provides it for free. (In dutch: www.vimexx.nl/help/varnish-cache-inschakelen).
      Do you have an opinion in this specific case? :) Thank you a lot!

  • @حقایق-ف5س
    @حقایق-ف5س 2 года назад

    can we use varnish as youtube cache?

  • @eliehaddad4908
    @eliehaddad4908 3 года назад

    i need hep to built the right cache server

  • @Joe-jc5ol
    @Joe-jc5ol 3 года назад +1

    But varnish is like a thousand times faster than having your web server and libraries compile to run redis to return a response...

  • @StefTechSurfer
    @StefTechSurfer 3 года назад

    Bad for WP?

  • @Stoney_Eagle
    @Stoney_Eagle 3 года назад

    Who is the certificate authority?

    • @hnasr
      @hnasr  3 года назад +3

      I talk about CA here ruclips.net/video/x_I6Qc35PuQ/видео.html

    • @Stoney_Eagle
      @Stoney_Eagle 3 года назад

      @@hnasr Thanks for replying, but I mean the authority of this https certificate. 😉

  • @DumanIshanov
    @DumanIshanov 2 года назад

    So basically, it's just an ordinary reverse proxy like nginx/haproxy? But has a lot of limitations compared to them. Looks like a useless thing for me...

  • @teckyify
    @teckyify 2 года назад

    Hardest problem in computer science? Are you willing to repeat that claim in front of the audience in my theoretical computer science lecture hall? :D