Upgrade to Pro — share decks privately, control downloads, hide ads and more …

私がエッジを使う理由

chimame
February 26, 2024

 私がエッジを使う理由

Workers Teck Tolks in Osaka #1

chimame

February 26, 2024
Tweet

More Decks by chimame

Other Decks in Programming

Transcript

  1. contents - Web ΞϓϦέʔγϣϯߏஙͷมભ - Web γεςϜʹ͓͚Δඞཁͳॲཧͷछྨ - ܭࢉϦιʔεͷ࠷దԽ -

    Edge computing ͷ׆༻ - Cloudflare Workers(Pages)ͷ࣮ྫ - ஫ҙ఺ - ·ͱΊ 2
  2. ओͳॲཧ 11 - (http)ϦΫΤετͷड෇ - ੩తίϯςϯπͷ഑৴ - ηογϣϯͷ؅ཧ - Ωϟογϡͷ؅ཧʢσʔλ΍ίϯςπͳͲ༷ʑʣ

    - ೝূ͓ΑͼೝՄ - ೖྗσʔλͷόϦσʔγϣϯ - (DBͳͲͷ)σʔλͷಡΈऔΓ΍࡞੒ͳͲͷ࣮ࢪ - ಈతίϯςϯπͷϨϯμϦϯά
  3. - (http)ϦΫΤετͷड෇ - ੩తίϯςϯπͷ഑৴ - ηογϣϯͷ؅ཧ - Ωϟογϡͷ؅ཧʢσʔλ΍ίϯςπͳͲ༷ʑʣ - ೝূ͓ΑͼೝՄ

    - ೖྗσʔλͷόϦσʔγϣϯ - (DBͳͲͷ)σʔλͷಡΈऔΓ΍࡞੒ͳͲͷ࣮ࢪ - ಈతίϯςϯπͷϨϯμϦϯά - ΫϥΠΞϯτ΁ͷϨεϙϯεੜ੒ ओͳॲཧ 12 ϑϩϯτΤϯυ͕୲͏ओͳ໾ׂ
  4. SSRͱCSRͷಛ௃ SSR CSR ϨϯμϦϯάΛ ࣮ࢪ͢Δ৔ॴ αʔό ΫϥΠΞϯτ ϖʔδભҠͷ ௨৴ྔ HTMLͱϖʔδʹ

    ඞཁͳ੩తϑΝΠϧ ϖʔδʹඞཁͳσʔ λͷΈ ඞཁͳ࠷௿γεςϜ਺ 1 2 15
  5. SSRͱCSRͷಛ௃ SSR CSR ϨϯμϦϯάΛ ࣮ࢪ͢Δ৔ॴ αʔό ΫϥΠΞϯτ ϖʔδભҠͷ ௨৴ྔ HTMLͱϖʔδʹ

    ඞཁͳ੩తϑΝΠϧ ϖʔδʹඞཁͳσʔ λͷΈ ඞཁͳ࠷௿γεςϜ਺ 1 2 16 αʔό͚ͩͷҰۃूதͷܭࢉϦιʔεͰ͸ͳ͘ɺ
 ΫϥΠΞϯτΛ࢖ͬͨܭࢉϦιʔεΛ෼ࢄ͢Δ఺Ͱ͸👍
  6. SSRͱCSRͷಛ௃ SSR CSR ϨϯμϦϯάΛ ࣮ࢪ͢Δ৔ॴ αʔό ΫϥΠΞϯτ ϖʔδભҠͷ ௨৴ྔ HTMLͱϖʔδʹ

    ඞཁͳ੩తϑΝΠϧ ϖʔδʹඞཁͳσʔ λͷΈ ඞཁͳ࠷௿γεςϜ਺ 1 2 17 ௨৴ྔ͕Լ͕Δͷ͸👍
 Ͱ΋SEOͱ͔ݴΘΕΔͱ…
  7. SSRͱCSRͷಛ௃ SSR CSR ϨϯμϦϯάΛ ࣮ࢪ͢Δ৔ॴ αʔό ΫϥΠΞϯτ ϖʔδભҠͷ ௨৴ྔ HTMLͱϖʔδʹ

    ඞཁͳ੩తϑΝΠϧ ϖʔδʹඞཁͳσʔ λͷΈ ඞཁͳ࠷௿γεςϜ਺ 1 2 18 ੩తͳϑΝΠϧ഑৴͚ͩͰߏஙͰ͖ͳ͍
 ৔߹͸γεςϜ਺͕૿͍͑ͯΔ👎
  8. SSRͱCSRͷಛ௃ SSR CSR ϨϯμϦϯάΛ ࣮ࢪ͢Δ৔ॴ αʔό ΫϥΠΞϯτ ϖʔδભҠͷ ௨৴ྔ HTMLͱϖʔδʹ

    ඞཁͳ੩తϑΝΠϧ ϖʔδʹඞཁͳσʔ λͷΈ ඞཁͳ࠷௿γεςϜ਺ 1 2 20 CSRΑ͏ͳܭࢉϦιʔεΛ෼ࢄͤͭͭ͞ɺ
 SSRΑ͏ͳҰఆͨ͠αʔόܭࢉϦιʔεΛ֬อͯ͠ɺ
 αʔό਺(؂ࢹ)ΛۃݶʹݮΒ͍͍͢ͱ͜औΓ͕͍ͨ͠
  9. લύʔτͰ಺༰(ৼΓฦΓ) 1. Web ΞϓϦέʔγϣϯߏஙͷมભ ύʔτ ϑϩϯτΤϯυͷॏཁੑ͕ු͖ூΓʹͳ͍͖ͬͯΞʔΩ ςΫνϟ͕ੜ·ΕΔͱಉ࣌ʹ໾ׂͷ෼཭͕ٸ଎ʹਐΉ 2. Web γεςϜʹ͓͚Δඞཁͳॲཧͷछྨ

    ύʔτ ϑϩϯτΤϯυ͸୺తʹݴ͑͹HTMLΛͲ͏ ”ϨϯμϦ ϯά ” ͢Δͷ͕ओͳ࢓ࣄͰ͋Δ(͋͘·ͰγεςϜత) 22 ॏཁੑ͸Θ͔Δ͕࢓ࣄྔͱͷόϥϯε
  10. 27 ੩తίϯςϯπͷߴ଎ͳ഑৴ Ϣʔβʔʹ͍ۙαʔόʔ͔Β ίϯςϯπΛ഑৴͢Δ ίϯςϯπͷΩϟογϡ ΦϦδϯͰੜ੒͞ΕΔಉҰ಺ ༰ΛΩϟογϡͯ͠഑৴͢Δ DDoS߈ܸͳͲ͔Βαʔό ʔΛอޢ͢Δ WAFͳͲΛ༻͍ͨηΩϡ

    ϦςΟڧԽ SSL/TLS΍http/3Λߦ͍ HTTPS௨৴ͷ࣮ݱ͢Δ HTTPS௨৴ͷޮ཰Խ D C W H CDNͷओͳ໾ׂ ಺༰͔Βݟͯ΋Θ͔Δ௨Γɺ΄΅ϑϩϯτΤϯυʹඞཁͳػೳ͕ ͋ΔαʔϏεͰ͋Δɻಛʹ্2ͭ͸਌࿨ੑ͕ඇৗʹߴ͍ɻ
  11. CDN্Ͱ࣮ߦͤ͞ΔϓϩάϥϜΛ࣮ߦͤ͞Δ͜ͱ͕Մ ೳͳ΋ͷ͕ଘࡏ͢Δ 28 - Cloudflare Workers - Fastly Compute -

    Lambda@Edge - Deno Deploy ϓϩάϥϜΛ࣮ߦ͢Δͱ͍͏͜ͱ͸ɺ͜Ε͸ࠓ·Ͱͷα ʔό/ΫϥΠΞϯτͱ͸ҟͳΔܭࢉϦιʔεͰ͋Δɻ 28
  12. 39

  13. Thank you! name: chimame / rito job: WebΤϯδχΞ field: Cloudflare,

    GCP, AWS, Ruby, Node.js, TypeScript, React, Next.js, Remix, Docker etc company: Goensגࣜձࣾ( https://about.goen-s.com ) twitter: @chimame_rt GitHub: chimame 51 Any questions?