Here is what Cloudflare Workers do

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

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

  • @franksonjohnson
    @franksonjohnson 4 года назад +96

    Using the "move line" keyboard shortcut in VS Code to animate a diagram of how service workers work is one of my favorite dev youtube moments in months 😂 just wonderful.

  • @Chaoticaa
    @Chaoticaa 3 года назад +8

    While my use-case for CF workers if pretty different from yours, I feel like you found an incredible use-case to really show the power of this platform. Short video, but answers everything I needed to know to confirm that this is exactly the platform I was looking for. Thanks for the great video. 👍

  • @JamesQQuick
    @JamesQQuick 4 года назад +4

    Really cool and practical example. Thanks Wes!

  • @mysticaltech
    @mysticaltech 4 года назад +4

    Damn, first time I ever see such a powerful trick, Cloudflare is great, thank you and keep up the amazing work.

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

    For other watchers: you can use regular expressions in Workers, so the last part of finding image URL will be more readable.

  • @kumarvishalben
    @kumarvishalben 4 года назад +6

    Moral Of The Story:
    use subfolder for random named stuff.

  • @r-i-ch
    @r-i-ch 4 года назад +5

    "If you want to replace every instance of 'cloud' with 'butt' on a website, you could absolutely do that here."
    saywhatnow? 🤣😄😆

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

    Lol, I use Droplr and for fun, just tried adding /content.jpg and now I can hotlink the screenshots.
    So in a roundabout way, thanks for showing me that :)
    Also, the workers look really cool!

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

      Fun fact, you can also do this in Droplr by just appending a "+" to the URL :)

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

      @@syropian Oh nice looks like both work.

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

    Now we saw css30, and your angular ideas :) haha.

  • @chris-ew9wl
    @chris-ew9wl 4 года назад +2

    Wes, it's not a nodejs script, It's Javascript using the Workers API. They run via Isolates which is a lighter construct compared to node running in a VM.

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

    I didn't know Jeremy Renner could code this well!

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

    That off axis headset is killing my OCD!

  • @nick-leffler
    @nick-leffler 3 года назад

    Remember also by enabling that orange cloud limits your max_upload_size to 100MB. Looks like you use mainly pictures so nothing to worry about, but keep that in mind.

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

    Very cool! Another cool thing you could do is to redirect wes.io to wesbos.com (and properly set the referrer) because I think that wes.io is a pretty cool domain name!

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

    Useful, thanks

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

    Hi Wes, why didn't you use Url Rewrite instead of a worker?

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

    Cool video, Wes. Watched a few times now.
    Is it possible to intercept google analytics and append the headers?

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

      I don’t think so because google analytics is on their own server

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

      @@WesBos yeah I thought that was stretching my luck. :) Self-hosting the main script it easy enough, it's the tracking pixel's expires header that I'm trying to append.

  • @connect-r
    @connect-r 4 года назад

    How to make Cookie stuffing whit cloud flare workers?

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

    Could you set the route for the worker to *wes.io/*/content* so that it is only used for the image requests and not the page requests?

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

      Nope - route wildcards can only be at the begin or the end of the route. Not in the middle :\

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

    Great content Wes! One question though -- To stop unnecessary request couldn't you put the route of the worker to *wes.io/*/content ? And that way you also don't have to check for forwarding request without /content? Cheers!

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

    "Why Wes posted a video about the work environment at Cloudflare?"

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

    That was cool

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

    How much would u charge me 2 put my website on me cloudfare workers for us pls

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

    seems like a cool way to secure your app with serverless permissions

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

    Hey man, I need help trying to use cloudflare workers to get information from a website and output it

  • @lazarom9998
    @lazarom9998 2 месяца назад

    I came here from googling "what is cloudflare workers" trying to find a 1 or 2 min video explaining it. Instead I got this loosy 23 min talk, and I'm tired of that bullshit, looking for a youtuber that knows to summarize

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

    const hasContentInUrl = request.url.indexOf("content") > -1

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

    I don't get it
    Is this same as netlify serverless functions?

    • @WesBos
      @WesBos  4 года назад +4

      Very similar, the only difference is that this runs before the DNS resolution which allows me to run serverless functions on a domain which points to a server I don't control

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

      They can do serverless stuff (just return a new Response object), but they can also operate as a really powerful proxy, that runs cheaply on every one of Cloudflare's edge servers. For instance, you could have a static website and use this to inject dynamic content.