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

Cloudflare Workers + R2で低コストで画像配信を移行した話/cloudfl...

Cloudflare Workers + R2で低コストで画像配信を移行した話/cloudflare_workers_r2_migration

Workers Tech Talks #1 #workers_tech
https://workers-tech.connpass.com/event/287490/
で発表した
「Cloudflare Workers + R2で低コストで画像配信を移行した話」の資料になります。

元ネタになった記事は以下になります。
https://qiita.com/teckl/items/4314aa210a689d08e759

Shigeki SUGAI

July 19, 2023
Tweet

More Decks by Shigeki SUGAI

Other Decks in Technology

Transcript

  1. ΞδΣϯμ w $MPVE fl BSF8PSLFSTͱ͸ w $MPVE fl BSF3ͱ͸ w

    Ҡߦ͢ΔࣄʹͳͬͨܦҢ w Ҡߦલͷߏ੒ w ҠߦͷྲྀΕ w ·ͱΊ
  2. $MPVEGMBSF8PSLFSTͱ͸ w IUUQTXXXDMPVE fl BSFDPNKBKQQSPEVDUTXPSLFST w αʔόϨε 'BB4  w

    -BNCEB!&EHF $MPVG'SPOU'VODUJPOTΈ͍ͨͳ΍ͭʢࡶʣ w +BWB4DSJQU 7 ͳͲ͕ಈ࡞ w 4FSWJDF8PSLFS͕ಈ͘ w ؆୯ͳ,7ʢLFZWBMVFʣͷΩϟογϡػೳ w ؆୯ͳΞϓϦέʔγϣϯͳΒαʔόϨεͰՄೳ
  3. $MPVEGMBSF3ͱ͸ w IUUQTXXXDMPVE fl BSFDPNKBKQQSPEVDUTS w "NB[PO4ޓ׵ͷΦϒδΣΫτετϨʔδ w ΤάϨεྉ͕ۚແྉ w

    4ͱൺ΂ͯ͞Βʹ௿ίετ w 4ͱҧ͍ɺϦʔδϣϯͷ֓೦͸ແ͍ w 8PSLFSTͱͷ࿈ܞ͕؆୯
  4. $MPVEGMBSF3ͷඅ༻ײ w 4ͱൺֱͯ͠ͲΕ͚ͩ҆͘ͳΔͷ͔ʁ w 31SJDJOH$BMDVMBUPS w IUUQTSDBMDVMBUPSDMPVE fl BSFDPN w

    Ϣʔεέʔεʹ΋ΑΔ͕ɺίετѹॖޮՌ͕ߴ͘ͳΔ͜ͱ͕ݟࠐ·ΕΔ w ྉۚମܥ͕ඇৗʹγϯϓϧ w 4ޓ׵ͳͷͰσʔλҠߦ΋ൺֱత༰қ
  5. Ҡߦલͷߏ੒ w 4 OHJOY &$ ʹΑΔଟஈߏ੒ w OHJOYDPOG͕ॳݟࡴ͠ w #BTJDೝূͷػೳͷ͓͔͛Ͱ݁ߏཪଆ͕ෳࡶͳࣄʹ

    ͳ͍ͬͯͨ w ཁ݅తʹ63-શͯʹରͯ͠ػցతͳ൑ఆ͕ग़དྷͣɺ /HJOY OHY@NSVCZͰ63-ຖʹ൑ఆ͍ͤͯͨ͞ w $%/Ҏ֎ʹ΋ೝূج൫Λҡ࣋͢Δίετ͕͔͔ͬ ͍ͯͨͨΊɺ$MPVE fl BSFҠߦΛػʹ#BTJDೝূػೳ ͸ഇࢭͯ͠γϯϓϧͳߏ੒ʹ͢Δࣄʹ
  6. ҠߦͷྲྀΕ  8PSLFSTػೳ࣮૷  ΞϓϦέʔγϣϯ͔Β4ͱ3΁ͷμϒϧϥΠτ࣮૷  43΁ͷϑϧίϐʔ  ੔߹ੑνΣοΫ 

    Ωϟογϡύʔδͷ࣮૷  ϩΪϯά  ੾Γସ͑ʢ/4ͷҕ೚ʣ  ࢒࡞ۀ  Ҡߦޙʹ൑໌ͨ͠໰୊
  7. 8PSLFSTػೳ࣮૷ ͦ΋ͦ΋3഑৴Ͱ8PSLFSTΛ࢖͏΂͖͔ʁ w ͷ3ͷ("ͷλΠϛϯάͰɺެ։όέοτ 1VCMJDCVDLFUT ͱ͍͏ػೳ͕ఏڙ͞ΕΔ Α͏ʹͳͬͨͨΊɺγϯϓϧͳόέοτͷެ։͚ͩͰ͋Ε͹8PSLFSTΛ௨͞ͳͯ͘΋഑৴Ͱ͖ ΔΑ͏ʹͳ͍ͬͯͨ w IUUQTEFWFMPQFSTDMPVE

    fl BSFDPNSCVDLFUTQVCMJDCVDLFUT w ύεͷϚοϐϯά͕γϯϓϧͳ৔߹͸ɺ8PSLFSTΛ࢖Θͣͱ΋3FXSJUF63-3VMFT͚ͩͰे෼ w IUUQTEFWFMPQFSTDMPVE fl BSFDPNSVMFTUSBOTGPSNVSMSFXSJUFFYBNQMFT w ͔͠͠ɺݱࡏར༻͍ͯ͠Δฐࣾ4ͷόέοτ͸ΦϯϓϨͷϑΝΠϧαʔό࣌୅͔Βଓͪ͘ΐͬ ͱ໽հͳύεߏ੒ʢޙड़ʣʹͳ͓ͬͯΓɺެ։όέοτػೳͦͷ··Ͱ͸࢖͑ͳ͍͜ͱ͕൑໌
  8. 8PSLFSTػೳ࣮૷ Ҡߦલͷը૾63-ͱόέοτͷΠϝʔδ 63- IUUQTIPHFIPHFFYBNQMFOFUJNBHFIFMMPKQH IUUQTUFTUTVCEPNBJOFYBNQMFOFUJNBHFBCDQOH όέοτ಺ύε IIPIPHFIPHFJNBHFIFMMPKQH UUFUFTUTVCEPNBJOJNBHFBCDQOH w αϒυϝΠϯ͸Ϣʔβ͕೚ҙʹࢦఆՄೳ

    w ΦϯϓϨ࣌୅ͷ໊࢒ͰαϒυϝΠϯͷ಄จࣈ͕֊૚ʹͳ͍ͬͯΔ FYIUUQTTBQOPSUIFBTUBNB[POBXTDPNYYYYQSPEVDUJPOIIPIPHFIPHFJNBHFIFMMPKQH MPDBUJPOd? QBUI \ JG IPTUd? EJS EJS EJS<?> a \ QSPYZ@QBTTIUUQOFYU@IPTUOFYU@QBUIEJSEJSEJSEJSEJSEJSQBUIJT@BSHTBSHT ^ ^
  9. 8PSLFSTػೳ࣮૷ ·ͣ͸8PSLFSTͰ3ͷϑΝΠϧදࣔΛݕূ w $MPVE fl BSF8PSLFSTΛ࢖͏͜ͱͰෳࡶͳύεฤू΍Ωϟογϡ੍ޚͳͲ͕Τ οδଆ͚ͩͰ࣮૷Մೳͳ͜ͱ͕൑໌ w ҎԼͷϖʔδͳͲΛࢀߟʹ࠷௿ݶͷදࣔ֬ೝ w

    <3VTU>$MPVE fl BSF8PSLFSTͰ3ʹΞΫηεͯ͠ΈΔ<5ZQF4DSJQU> w IUUQTEFWDMBTTNFUIPEKQBSUJDMFTXPSLFSTS w IUUQTEFWFMPQFSTDMPVE fl BSFDPNSBQJXPSLFSTXPSLFSTBQJVTBHF
  10. 8PSLFSTػೳ࣮૷ $BDIFʹ͍ͭͯิ଍ w ϑΝΠϧ݅਺͕গͳ͔ͬͨΓɺγϯϓϧͳαΠτͷ৔߹͸ɺ$BDIF"1*ΑΓ΋,7΍%VSBCMF 0CKFDUT GFUDIDG౳͕ྑͦ͞͏Ͱ͢ w IUUQTEFWFMPQFSTDMPVE fl BSFDPNXPSLFSTSVOUJNFBQJTSFRVFTUSFRVFTUJOJUDGQSPQFSUJFT

    w ·ͨɺ$BDIF"1*͸Τοδαʔό୯ҐͰͷΩϟογϡͱͳΔͨΊɺҰճͷϦΫΤετͰ͸શ෦ͷΩϟ ογϡ͕ೖΔ༁Ͱ͸ແ͍ͷͰ஫ҙ w ,7ͩͱෳ਺ڌ఺ؒͰڞ༗͞ΕΔ w $BDIF"1*͸ෳ਺ճͷϦΫΤετ͕ඞཁ w ฐࣾͷ৔߹͸αΠτ͕αϒυϝΠϯܗࣜͰେྔͷաڈը૾͕ଘࡏ͢ΔͨΊɺίετΛ࠷༏ઌͯ͠ $BDIF"1*Λ࠾༻
  11. 8PSLFSTػೳ࣮૷ ༨ஊɿը૾഑৴ʹ͍ͭͯ w αʔϏεͷཁ݅ʹ΋ΑΓ·͕͢ɺྫ͑͹ίετ໘ΑΓ΋ॊೈͳը૾ϦαΠζ΍୺ ຤ຖͷࣗಈ࠷దԽΛ͍ͨ͠ͷͰ͋Ε͹ʮ$MPVE fl BSF*NBHFTʯ΍ʮ$MPVE fl BSF *NBHF3FTJ[JOHʯͱ͍ͬͨαʔϏεΛબఆ͢Δͷ΋ΞϦͩͱࢥ͍·͢

    w IUUQTXXXDMPVE fl BSFDPNKBKQQSPEVDUTDMPVE fl BSFJNBHFT w IUUQTEFWDMBTTNFUIPEKQBSUJDMFT DMPVE fl BSFJNBHFT@SFTJ[JOH@BOE@QPMJTI w IUUQTEFWFMPQFSTDMPVE fl BSFDPNJNBHFTJNBHFSFTJ[JOH
  12. 4͔Β3΁ͷશσʔλίϐʔ ํ๏SDMPOFͰҠߦ w 3DMPOFͱ͸ΦʔϓϯιʔεͷίϚϯυϥΠϯϕʔεͷϑΝΠϧಉظ͓Αͼసૹ πʔϧ w IUUQTSDMPOFPSH w $MPVE fl

    BSFެࣜͰ΋3ͰͷSDMPOFͷ࢖͍ํΛ঺հ͞Ε͍ͯΔ w IUUQTEFWFMPQFSTDMPVE fl BSFDPNSFYBNQMFTSDMPOF w 34VQFS4MVSQFS͸·ͩϕʔλ൛Ͱ͋ΓɺόέοτͷαΠζ΍ίϐʔͷλΠϛ ϯά੍ޚͳͲʹෆ͕҆͋ͬͨͨΊɺࠓճ͸ͪ͜ΒͷSDMPOFΛ࢖༻͢Δ͜ͱʹ
  13. 4͔Β3΁ͷશσʔλίϐʔ ίϐʔʹ͔͔Δ3ૢ࡞ؔ࿈ͷίετνΣοΫ w ڊେͳόέοτΛίϐʔ͢Δ࣌͸ͲΕ͚ͩͷΦϒδΣΫτૢ࡞Ͱίετ͕͔ ͔Δ͔Λ44UPSBHF-FOT౳Ͱ༧Ί༧ଌ͓ͯ͘͠ͱྑ͍ w IUUQTEFWFMPQFSTDMPVE fl BSFDPNSQMBUGPSNQSJDJOH w

    $MBTT"0QFSBUJPOTʢ-JTU0CKFDUT 1VU0CKFDUͳͲʣ w $MBTT#0QFSBUJPOTʢ)FBE0CKFDU (FU0CKFDUͳͲʣ͕ݱঢ়ͲΕ͚͔ͩ ͔͍ͬͯͯɺҠߦͰͲΕ͚͔͔ͩΓͦ͏͔Λ೺Ѳ͢Δ w 3ଆ͚ͩͰͳ͘ɺ4ଆͷίετ΋৻ॏʹνΣοΫ
  14. 4͔Β3΁ͷશσʔλίϐʔ /"5(BUFXBZ՝ۚͷ᠘ w ҎԼͷهࣄͳͲ͕ࢀߟʹͳΓ·ͨ͠ɻɻ w ͦͷτϥϑΟοΫɺ/"5ήʔτ΢ΣΠΛ௨͢ඞཁ͋Γ·͔͢ʁద੾ͳܦ࿏Ͱෆཁͳσʔλॲཧྉ ۚ͸࡟ݮ͠·͠ΐ͏ w IUUQTEFWDMBTTNFUIPEKQBSUJDMFTSFEVDFVOOFDFTTBSZDPTUTGPSOBUHBUFXBZ w

    &$͔Β4΁ΞΫηε͢Δͭͷϧʔτͱίετ w IUUQTUFDIOSJOFUDPNFOUSZBDDFTT@SPVUFT@GSPN@&$@UP@4 w ΍͸Γ͜͏͍͏࡞ۀΛ͢Δࡍ͸ɺ୹ظؒͰҰؾʹίϐʔΛߦΘͣɺ$PTU&YQMPSFSΛࡉ͔͘νΣο Ϋ͠ͳ͕ΒͦΕͳΓʹ࣌ؒΛ͔͚ͯ΍͍ͬͯ͘ͷ͕ྑͦ͞͏ w ७ਮʹίϐʔ଎౓͕ૣ͚Ε͹ྑ͍ͱ͍͏΋ͷͰ΋ແ͍ͷͰ೉͍͠ͱ͜Ζ
  15. ੔߹ੑνΣοΫ w 8PSLFST͸ෳ਺ͷΧελϜυϝΠϯΛϚοϐϯά͢Δࣄ͕Մೳ w ຊ൪ͱ͸ผͷԾυϝΠϯΛ༻ҙͯ͠ɺࣄલʹݟൺ΂ग़དྷΔΑ͏ʹςετ w QSPEVDUJPOFYBNQMFOFUʢຊ൪༻υϝΠϯʣ w QSPEVDUJPOFYBNQMFDPNʢ੔߹ੑνΣοΫ༻υϝΠϯʣ w

    ࣮ࡍʹαʔϏεͰ࢖ΘΕΔ63-ΛϥϯμϜʹੜ੒ͯ͠Ϩεϙϯείʔυ  A$POUFOU5ZQFA A$POUFOU-FOHUIAͳͲͷൺֱΛߦ͏εΫϦϓτΛ༻ҙ w ͜ͷ੔߹ੑνΣοΫʹΑΓҰ෦όέοτͷίϐʔ࿙ΕΛݕ஌ग़དྷ·ͨ͠ʜ
  16. Ωϟογϡύʔδͷ࣮૷ ୯ҰϑΝΠϧ࡟আͷ৔߹ w $MPVE fl BSF$BDIF"1*Λ࢖ͬͯΩϟογϡ͍ͯ͠Δ৔߹͸Ωϟογϡͷύ ʔδΛ$MPVE fl BSF"1*Λ࢖ͬͯߦ͏ඞཁ͕͋Δ w

    IUUQTEFWFMPQFSTDMPVE fl BSFDPNDBDIFIPXUPQVSHF DBDIFQVSHFCZTJOHMF fi MFCZVSM w $MPVE'SPOUͷ*OWBMJEBUJPOTͱ͸ҧ͍ɺ$MPVE fl BSFͷΩϟογϡύʔδϦΫ Τετࣗମ͸ແྉͷͨΊɺίετ͸ؾʹͤͣʹૉ๿ʹ࡟আ͞ΕͨϑΝΠϧ ͷ63-ΛదٓΩϡʔʹೖΕͯ౤͛ΔΑ͏ʹΞϓϦέʔγϣϯଆʹ૊ΈࠐΈ
  17. Ωϟογϡύʔδͷ࣮૷ Ұׅ࡟আͷ৔߹ w ෳ਺ϑΝΠϧͷҰׅ࡟আͷ৔߹ɺ$MPVE'SPOUͷ*OWBMJEBUJPOͰ͸αϒυϝ ΠϯʹରԠ͍ͯ͠ͳ͍୅ΘΓʹύε୯ҐͰϫΠϧυΧʔυύʔδ͕ར༻Մೳ ͩͬͨ w $MPVE fl BSFͷ৔߹͸ɺϫΠϧυΧʔυͷ୅ΘΓʹUBH΍QSF

    fi YͰҰׅ࡟আͱ ͍͏΋ͷ͕ଘࡏ͢ΔͷͰ͜ΕΛར༻ʢཁ&OUFSQSJTF1MBOʣ w IUUQTEFWFMPQFSTDMPVE fl BSFDPNBQJPQFSBUJPOT[POF QVSHFQVSHFDBDIFEDPOUFOUCZUBHIPTUPSQSF fi Y
  18. ϩΪϯάͷઃఆ -PHQVTI w ࣌ؒΛࢦఆͯ͠ಛఆͷϩάΛऔΓग़͢৔߹ w IUUQTEFWFMPQFSTDMPVE fl BSFDPNMPHTSMPHSFUSJFWBMSFUSJFWF MPHTCZUJNFSBOHF w

    ϩάͷྲྀྔ͕ଟ͍ͱ࣌ؒൣғΛখࠁΈʹ͢Δඞཁ͕͋ΔͷͰ஫ҙ DVSMTH9(&5IUUQTBQJDMPVE fl BSFDPNDMJFOUWBDDPVOUT"$$06/5@*%MPHTSFUSJFWF TUBSU5;FOE5;CVDLFUDMPVE fl BSFMPHTQSF fi YIUUQ@SFRVFTUTFYBNQMFDPN\%"5&^a )9"VUI&NBJM&."*-a )9"VUI,FZ"1*@,&:a )3"DDFTT,FZ*E3@"$$&44@,&:@*%a )34FDSFU"DDFTT,FZ3@4&$3&5@"$$&44@,&:cKR
  19. ੾Γସ͑ʢ/4ͷҕ೚ʣ αϒυϝΠϯ୯ҐͷυϝΠϯ੾Γସ͑ͷ৔߹ w ఀࢭϝϯςφϯεΛ͠ͳ͍ͰࡁΉΑ͏ʹɺ1BSUJBM $/".& TFUVQΛར༻ͯ͠੾Γସ͑Λߦͬͨ w IUUQTEFWFMPQFSTDMPVE fl BSFDPNEOT[POFTFUVQTQBSUJBMTFUVQTFUVQ

    1BSUJBM $/".& TFUVQͰຊ൪༻υϝΠϯΛೝূͤ͞Δ ݩʑ3PVUFΛར༻͍ͯͨ͠ͷͰɺ3PVUFଆͰADMPVE fl BSFWFSJGZFYBNQMFOFUAͷΑ͏ͳ595Ϩί ʔυΛ࡞੒ $MPVE fl BSFଆͷ%/4ʹ༧Ίطଘͷ3PVUFͱಉ͡ϨίʔυΛ͢΂ͯઃఆ͓ͯ͘͠ 3PVUFଆͷ$MPVE'SPOUͷ"MJBTϨίʔυͱಉ͡ϨίʔυΛ$MPVE fl BSFଆʹ΋$/".&Ͱొ࿥͓ͯ͠ ͘ɻ͜ͷࡍɺ1SPYJFEͰ͸ͳ͘ʮ%/4POMZʯͱ͢Δ 8PSLFSTͷ$VTUPN%PNBJOΛઃఆ
  20. ੾Γସ͑ʢ/4ͷҕ೚ʣ ;POF"QFYʢωΠΩουυϝΠϯʣͷ੾Γସ͑ͷ৔߹ ޙ೔ߦͬͨผαʔϏεͷ$MPVE fl BSF8PSLFST 3ҠߦͰ͸ɺ;POF"QFYʢωΠΩου υϝΠϯʣͷ੾Γସ͑ͱͳͬͨͨΊɺ্Ґ%/4ͷΩϟογϡ໰୊ʢʁʣͳͲ͕ൃੜ͠· ͨ͠ɻ ΧελϜυϝΠϯͷ൓ө͕ͳ͔ͳ͔͞Εͳ͍ʢ&EHF$FSUJ fi

    DBUFTͷऔಘ͕ਐ·ͳ͍ʣͱ ͍͏໰୊͕ؔ࿈͓ͯ͠Γɺ৔߹ʹΑͬͯ͸ϦϦʔε೔࣌ͷௐ੔ʹ͸஫ҙ͕ඞཁͦ͏Ͱ͢ɻ ઌ೔ͷهࣄʹগ͠௥هΛߦ͍ͬͯΔͷͰڵຯͷ͋Δํ͸ࢀߟʹ͍ͯͩ͘͠͞ɻ IUUQTRJJUBDPNUFDLMJUFNTBBBEF
  21. ࢒࡞ۀ w $MPVE fl BSF3 8PSLFST؀ڥʹ੾Γସ͑ޙɺ͠͹Β͘ͷظؒฒߦՔಈͰ༷ ࢠΛݟͭͭɺ੾Γ໭͠ͷඞཁ͕ແ͘ͳͬͨͱ൑அग़དྷͨλΠϛϯάʹͳͬͨ ΒΞϓϦέʔγϣϯଆͷ4ͱ3΁ͷμϒϧϥΠτͷ࢓૊ΈΛഇࢭ͠ɺ3ͷ Έॻ͖ࠐΈͷγϯάϧߏ੒ʹมߋ͢Δ w

    ఆظతʹ࡟আ͢Δཁ݅ͳͲ͕͋Ε͹ϥΠϑαΠΫϧϧʔϧͷ૊ΈࠐΈ w 4όέοτ΍$MPVE'SPOUͷσΟετϦϏϡʔγϣϯͳͲɺؔ࿈͢ΔϦιʔε ͷΞʔΧΠϒ΍૟আΛߦ͏ w Ҏ্ͰҠߦ࡞ۀͱͯ͠͸ऴྃʹͳΓ·͢
  22. Ҡߦޙʹ൑໌ͨ͠໰୊ SDMPOFͷ᠘ͦͷɿΦϒδΣΫτΩʔʹ͕ଘࡏ͍ͯ͠Δྫ֎έʔε w 4όέοτ಺ʹͱ͍͏ΦϒδΣΫτΩʔ͕ଘࡏ͍ͯ͠Δͱ3ʹҠߦग़དྷ͍ͯͳ͍໰୊͕൑໌ w ྫʣ w IUUQTIPHFIPHFFYBNQMFOFUEVQMJDBUFGPXBSETMBTIQOH w IUUQTIPHFIPHFFYBNQMFOFUJNBHFIPHFKQH

    BXTTMTTYYYCVDLFUQSPEVDUJPOIIPIPHFIPHFcXDM  BXTTMTTYYYCVDLFUQSPEVDUJPOIIPIPHFIPHFcXDM  ͱ͸ผ෺ SDMPOFDPQZTYYYCVDLFUQSPEVDUJPOIIPIPHFIPHFSYYYCVDLFUQSPEVDUJPOIIPIPHFIPHF ্هͩͱAA഑Լ͚͕ͩίϐʔग़དྷ͍ͯͳ͍໰୊
  23. Ҡߦޙʹ൑໌ͨ͠໰୊ SDMPOFͷ᠘ͦͷɿΦϒδΣΫτΩʔʹ͕ଘࡏ͍ͯ͠Δྫ֎έʔε 3ʹۭͷόέοτΛ४උͯ͠ςετͯ͠ΈΔͱ BXTTMTTUFTUCVDLFU 13& DMPVE fl BSF@XPSLFSTQOH BXTTMTTUFTUCVDLFU HJUIVCQOH

    SDMPOFMTTUFTUCVDLFU HJUIVCQOH DMPVE fl BSF@XPSLFSTQOH SDMPOFMTSUFTUCVDLFU  SDMPOFDPQZTUFTUCVDLFUSUFTUCVDLFU &3303&OUSZEPFTOUCFMPOHJOEJSFDUPSZ TBNFBTEJSFDUPSZ JHOPSJOH SDMPOFMTSUFTUCVDLFU DMPVE fl BSF@XPSLFSTQOH AAͱ͍͏ΦϒδΣΫτΩʔ͕ҠߦͰ͖͍ͯͳ͔ͬͨɻʢΦϒδΣΫτΩʔʹ͕ೖ͍ͬͯͳ͍ϑΝΠϧ͚͕ͩίϐʔ͞ΕΔʣ
  24. Ҡߦޙʹ൑໌ͨ͠໰୊ SDMPOFͷ᠘ͦͷɿΦϒδΣΫτΩʔʹ͕ଘࡏ͍ͯ͠Δྫ֎έʔε w ͔ͳΓͷྫ֎έʔεͰ͸͕͋ͬͨɺಛघͳύλʔϯͰଘࡏ͍ͯͨ͠ w ͦ΋ͦ΋ΦϒδΣΫτΩʔʹAAΛڐ༰͢Δ΂͖Ͱ͸ͳ͍ w ΞϓϦέʔγϣϯଆͰೖΒͳ͍Α͏ʹ͢΂͖ w ͱ͸ݴ͑௕͍αʔϏεͳͷͰ͘͝Ұ෦ͷϢʔεέʔεͰଘࡏ͍ͯͨ͠

    w ݱঢ়ͷSDMPOFͰ͸͜ͷέʔε͸ҠߦରԠग़དྷͳ͍ͨΊɺ"84$-*ͰόέοτΛमਖ਼ͯ͠ରԠ w ͜͏͍͏έʔε΋͋ͬͨΓ͢ΔͷͰɺҠߦޙͷ4ଆόέοτͷ࡟আλΠϛϯά͸ཁ஫ҙ w 41SF fi YFTXJUIDBVTFTSDMPOFDPNNBOETUPGBJMMPPLGPSUIF XSPOHPCKFDUT w IUUQTHJUIVCDPNSDMPOFSDMPOFJTTVFT
  25. Ҡߦޙʹ൑໌ͨ͠໰୊ SDMPOFͷ᠘ͦͷɿΦϒδΣΫτΩʔʹ͕ଘࡏ͍ͯ͠Δྫ֎έʔε export default { async fetch(request, env, context) {

    try { let requestUrl = request.url; // "%3F" Λ "?" ʹஔ׵ requestUrl = requestUrl.replace("%3F", "?"); // "//" Λ "/" ʹஔ׵ʢͨͩ͠ "https://" ͷεϥογϡ͸ͦͷ··ʣ requestUrl = requestUrl.replace(/([^:]\/)\/+/g, "$1"); const url = new URL(requestUrl); // Construct the cache key from the cache URL const cacheKey = new Request(url.toString(), request); w ࣅͨΑ͏ͳ໰୊ͰɺΦϒδΣΫτΩʔʹ63*ΤϯίʔυͷAA͕࢖ΘΕ͍ͯΔέʔε΋ଘࡏͯ͠ ͍ͨ w 3಺෦ͷΦϒδΣΫτΩʔΛ͢΂ͯ੔ཧͨ͠ޙͰɺҎԼͷΑ͏ʹ63-ΛϊʔϚϥΠζͯ͠ରԠ
  26. ·ͱΊ w $MPVE'SPOU 4؀ڥ͔Β$MPVE fl BSF3 8PSLFSTʹҠߦ͢Δํ๏ͷҰྫͱϋϚͬͨ໰୊Λ঺ հ͠·ͨ͠ɻ w $MPVE

    fl BSF8PSLFST 3؀ڥʹҠߦ͔Βϲ݄΄Ͳܦա͠·͕ͨ͠ɺࠓͷͱ͜Ζ᠘Ͱ঺հͨ݅͠ Ҏ֎ʹ͸େ͖ͳ໰୊͸ൃੜ͍ͯ͠·ͤΜɻΩϟογϡώοτ཰΋ҠߦલͱมΘΒͣɺύϑΥʔϚϯ εʹ͍ͭͯ΋ಛʹ໰୊ແ͘ӡ༻Ͱ͖͍ͯ·͢ɻ w ಛʹίετ໘ʹ͍ͭͯ͸ඇৗʹେ͖ͳΠϯύΫτ͕͋Γ·ͨ͠ɻ w 8PSLFSTΛબ୒ͨ͜͠ͱͰࡉ͔͍ௐ੔΋͠΍͘͢ɺը૾഑৴༻ͷαʔόӡ༻͔Β։์͞Εͨͷ͸ඇ ৗʹਫ਼ਆతʹ΋ྑ͍ w 8PSLFST͸೔ʑਐԽ͍͍ͯͬͯͯ͠ඇৗʹָ͍͠෼໺ͳͷͰɺଞͷҊ݅ͳͲͰ΋ద༻ग़དྷͦ͏ͳΒ ࢼ͍͖͍ͯͨ͠