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

/fastly-yamagoya-meetup-2019

5292dd0924f5e440a4b7ff40b165a0b4?s=47 tkuchiki
October 23, 2019

 /fastly-yamagoya-meetup-2019

5292dd0924f5e440a4b7ff40b165a0b4?s=128

tkuchiki

October 23, 2019
Tweet

Transcript

  1. .FSQBZʹ͓͚Δ 'BTUMZ׆༻ࣄྫ 'BTUMZZBNBHPZBNFFUVQ !ULVDIJLJ 1 https://speakerdeck.com/tkuchiki/fastly-yamagoya-meetup-2019

  2. 8)0".*  w!ULVDIJLJ w43&BU.FSQBZ

  3. "HFOEB wϝϧϖΠ֓ཁ wͳͥ'BTUMZΛબΜͩͷ͔ wϝϧϖΠͷΞʔΩςΫνϟ w'BTUMZͷӡ༻Λࢧ͑Δٕज़ w5FSSBGPSNʹΑΔઃఆ؅ཧ w%BUBEPHʹΑΔ؂ࢹ w#JH2VFSZΛ࢖ͬͨ-PHHJOHͱݕࡧ wΩϟογϡύʔδ w੩తϑΝΠϧ഑৴

    w,VCFSOFUFTΛCBDLFOEʹͨ͠"1*
  4. ϝϧϖΠ֓ཁ ίʔυ෷͍ J% ͋ͱ෷͍ ωοτܾࡁ ೥݄ ඇ઀৮ܕαʔϏεʮJ%ʯʹରԠ J04"OESPJE ೥݄ େखνΣʔϯ΍தɾখن໛ళฮͰ

    23ɾόʔίʔυܾࡁʹରԠ ೥݄ ೥݄ ෳ਺ճͷ͓ങ͍෺Λ͋ͱ͔Β·ͱΊͯࢧ෷͑Δ ʮϝϧϖΠ͋ͱ෷͍ʯ։࢝ &$αΠτͰ΋ʮϝϧϖΠʯ͕ར༻Ͱ͖Δ ωοτܾࡁఏڙ։࢝ શࠃ ສ͔ॴ https://jp.merpay.com/ Ϣʔβʔ਺ ສਓ Ϣʔβʔ਺ ສਓ ೥݄
  5. ϝϧϖΠͷαʔϏεن໛ wϚΠΫϩαʔϏεΞʔΩςΫνϟ wҎ্ͷϚΠΫϩαʔϏε w2ͰԯԁҎ্ΛऔΓѻ͏ϝϧΧϦͷܾࡁج൫ w64ͷϝϧΧϦࣄۀ΋ؚΉ਺ࣈ wສਓҎ্ͷར༻ऀ wϝϧϖΠʮిࢠϚωʔʯͷొ࿥ΛߦͬͨϢʔβʔͱɺʮϝϧϖΠίʔ υ෷͍ʯɺʮωοτܾࡁʯɺʮϝϧϖΠ͋ͱ෷͍ʯ౳ͷར༻ऀͷ߹ܭ ॏ ෳΛআ͘

  6. ͳͥ'BTUMZΛબΜͩͷ͔ wϔομͷઃఆ΍*1੍ݶͳͲΛ7$-Ͱॊೈʹهड़Ͱ͖Δ w'BTUMZͱ($1͸૬ޓʹ௚઀઀ଓ͞Ε͍ͯΔͨΊ௿ϨΠςϯγͰ ௨৴Ͱ͖Δ wIUUQTXXXGBTUMZKQQBSUOFSHDQ w#JH2VFSZ΁ͷϦΞϧλΠϜϩάετϦʔϛϯά΍%BUBEPH JOUFHSBUJPOʹΑΓɺӡ༻ʹඞཁͳ৘ใΛ؆୯ʹऩूͰ͖Δ wߴ଎ͳΩϟογϡύʔδ w'BTUMZ8"'ʹΑΔηΩϡϦςΟ޲্

  7. ϝϧϖΠͷΞʔΩςΫνϟ

  8. γεςϜΞʔΩςΫνϟ w։ൃ؀ڥɾຊ൪؀ڥͱ΋ʹશͯͷΫϥΠΞϯτ͔ΒͷϦΫΤετ͸ 'BTUMZΛ௨͍ͯ͠Δ w"1*ɺ8FCGSPOUFOE 4FSWFS4JEF3FOEFSJOH ɺ੩తϑΝΠϧ w"1* wνϟʔδ ೖۚ ɺ࢒ߴཤྺɺΫʔϙϯɺίʔυܾࡁ

    wFUD w੩తϑΝΠϧ wը૾ w)5.-ɺ$44ɺ+BWB4DSJQU
  9. $MJFOUT 'BTUMZ *OHSFTT (,& ,VCFSOFUFT "1* (BUFXBZ "1* 4FSWJDF9 "1*

    4FSWJDF: 8FC 4FSWJDF; #BDLFOE 4FSWJDF" #BDLFOE 4FSWJDF# γεςϜΞʔΩςΫνϟ "VUIPSJUZ ($4 'BTUMZ ੩తϑΝΠϧ )."$ $MPVE4QBOOFS $MPVE1VC4VC ($11SPKFDU" $MPVE4QBOOFS ($11SPKFDU#
  10. γεςϜΞʔΩςΫνϟ $MJFOUT ΞϓϦɺՃໍళ౳ͷύʔτφʔ༷ $%/ 'BTUMZ ੩తϑΝΠϧ഑৴ɾΩϟογϡ ΫϥΠΞϯτͱͷ5$1઀ଓΛΤοδαʔόͱߦͳ͏͜ͱʹΑΔ௨৴ͷ࠷దԽ "1*(BUFXBZ શͯͷϦΫΤετ͕"1*(BUFXBZΛ௨Δ ڞ௨ॲཧͱϧʔςΟϯά

    "1*4FSWJDF ΫϥΠΞϯτ͔ΒͷϦΫΤετͱϨεϙϯεʹ੹೚Λ࣋ͭ ཪଆʹ͋Δෳ਺ͷϚΠΫϩαʔϏεͷΞάϦήʔγϣϯ #BDLFOE4FSWJDF ػೳͷϩδοΫΛ࣮ݱ͢Δ
  11. 'BTUMZ ΠϯϑϥΞʔΩςΫνϟ #JH2VFSZ $MPVE4UPSBHF $MPVE'VODUJPOT (JU)VC 5FSSBGPSN 4MBDL %FWFMPQFST%FTJHOFST QMBOBQQMZ

    6QMPBE -PH -PH .FUSJDT 1VTI 1VSHF $POpHVSBUJPO $PNNFOU 4FBSDI 1VSHF 4MBTIDPNNBOE )551 3FRVFTU
  12. 'BTUMZͷӡ༻Λࢧ͑Δٕज़

  13. 5FSSBGPSNʹΑΔઃఆ؅ཧ w'BTUMZTFSWJDF͸શͯ5FSSBGPSNͰ؅ཧ wׂΓ౰͍ͯͯΔυϝΠϯ΋ w$JSDMF$*ͰUFSSBGPSNQMBOBQQMZΛ࣮ߦ wCSBODIʹQVTIͨ͠ͱ͖ʹQMBO wNBTUFSCSBODIʹNFSHFͨ͠ͱ͖ʹBQQMZ wUFSSBGPSNQMBOBQQMZͷ࣮ߦ݁Ռ͸UGOPUJGZͰ1VMM3FRVFTUʹίϝϯτ ͱͯ͠௨஌ wࢀߟϝϧΧϦ.JDSPTFSWJDFT5FBNʹΑΔ5FSSBGPSNӡ༻ͱͦͷதͰ։ൃͨ͠ 044ͷ঺հ

    w IUUQTUFDINFSDBSJDPNFOUSZ
  14. UGOPUJGZ࣮ߦྫ

  15. %BUBEPHʹΑΔ؂ࢹ w%BUBEPHͷ'BTUMZJOUFHSBUJPOͰNFUSJDTΛऩू wIUUQTEPDTEBUBEPHIRDPNKBJOUFHSBUJPOTGBTUMZNFUSJDDPMMFDUJPO wGBTUMZIJU@SBUJP wGBTUMZTUBUVT@YYdGBTUMZTUBUVT@YY wGBTUMZCBOEXJEUI wFUD w8"'༻ͷNFUSJDT΋͋Δ w GBTUMZXBG@CMPDLFE

    w GBTUMZXBG@MPHHFE w FUD
  16. άϥϑ ։ൃ؀ڥͷάϥϑͰ͢

  17. %BUBEPHʹΑΔ؂ࢹ w؂ࢹ w)5514UBUVT$PEF΍YYͷൃੜ਺ w0CKFDUαΠζ͝ͱͷ഑৴਺͕औΕΔͷͰɺ.#Ҏ্ͷ0CKFDU͕૿ ͑ͨΒΞϥʔτΛग़͢ɺͳͲ w GBTUMZPCKFDU@TJ[F@N.#d.#

  18. #JH2VFSZΛ࢖ͬͨ-PHHJOHͱݕࡧ wϦΞϧλΠϜϩάετϦʔϛϯάͰ#JH2VFSZʹૹ৴ wϩάܽଛΛ๷͙ͨΊʹɺ($4ʹ΋ग़ྗ w)5514UBUVT$PEFYY͕ൃੜͨ͠৔߹ͳͲɺௐࠪͷͨΊʹ #JH2VFSZΛࢀর wQBUI͝ͱͷΤϥʔൃੜ਺ΛΧ΢ϯτ w/ඵҎ্͔͔͍ͬͯΔϦΫΤετҰཡ wશମͷ)5514UBUVT$PEFYYൃੜ਺ͳͲ͸%BUBEPHͰݟͯ ͍Δ

  19. Ωϟογϡύʔδ w4MBDLͷTMBTIDPNNBOEܦ༝Ͱύʔδ wඇΤϯδχΞ޲͚ wࢀߟ(PPHMF$MPVE'VODUJPOTΛ࢖ͬͯ4MBDLͰ؆୯ʹ$%/্ͷ ΩϟογϡΛফͤΔΑ͏ʹ͢Δ࿩ w IUUQTUFDINFSDBSJDPNFOUSZ w ΤϯδχΞ޲͚ʹ͸ɺXHFUͷ࠶ؼతʹϦϯΫΛḷΔػೳΛ࢖ ͍ɺࢦఆͨ͠63-͔ΒࢀরͰ͖Δ63-શͯʹ163(&ϦΫΤ

    ετΛૹΔεΫϦϓτΛڞ༗ w IUUQTHJTUHJUIVCDPNULVDIJLJEFDEEFEBECEDBD
  20. εΫϦϓτ for url in $(LANG=C wget -p -nv -nd -r

    --spider \ ${base_url} -o /dev/stdout \ | grep URL | sed -e 's/URL://' \ | awk '{print $3}'); do curl -X PURGE $url echo "purged ${url}" sleep 0.1 done
  21. ੩తϑΝΠϧ഑৴

  22. $MJFOUT 'BTUMZ *OHSFTT (,& ,VCFSOFUFT "1* (BUFXBZ "1* 4FSWJDF9 "1*

    4FSWJDF: 8FC 4FSWJDF; #BDLFOE 4FSWJDF" #BDLFOE 4FSWJDF# ΞʔΩςΫνϟ "VUIPSJUZ ($4 'BTUMZ ੩తϑΝΠϧ )."$ $MPVE4QBOOFS $MPVE1VC4VC ($11SPKFDU" $MPVE4QBOOFS ($11SPKFDU#
  23. ($4 w'BTUMZ͔Β($4ʹ)."$ೝূͯ͠ϓϥΠϕʔτΦϒδΣΫτΛ഑৴ wIUUQTEPDTGBTUMZDPNFOHVJEFTHPPHMFDMPVETUPSBHF w($4Ͱ഑৴͢ΔϑΝΠϧ͸(JU)VCͰ؅ཧ wߋ৽͢Δͷ͸σβΠφʔɺϑϩϯτΤϯυΤϯδχΞ w$JSDMF$*ͰҎԼΛߦͳ͏ w($4ʹΞοϓϩʔυ wมߋͷ͋ͬͨϑΝΠϧΛύʔδ wαΠζ͕େ͖͗͢ΔϑΝΠϧ͕͋ͬͨ৔߹ʹ1VMM3FRVFTUͷίϝϯτͰܯࠂ ͢Δ

  24. 'BTUMZ ΠϯϑϥΞʔΩςΫνϟ #JH2VFSZ $MPVE4UPSBHF $MPVE'VODUJPOT (JU)VC 5FSSBGPSN 4MBDL %FWFMPQFST%FTJHOFST QMBOBQQMZ

    6QMPBE -PH -PH .FUSJDT 1VTI 1VSHF $POpHVSBUJPO $PNNFOU 4FBSDI 1VSHF 4MBTIDPNNBOE )551 3FRVFTU
  25. ,VCFSOFUFTΛ CBDLFOEʹͨ͠"1*

  26. $MJFOUT 'BTUMZ *OHSFTT (,& ,VCFSOFUFT "1* (BUFXBZ "1* 4FSWJDF9 "1*

    4FSWJDF: 8FC 4FSWJDF; #BDLFOE 4FSWJDF" #BDLFOE 4FSWJDF# ΞʔΩςΫνϟ "VUIPSJUZ ($4 'BTUMZ ੩తϑΝΠϧ )."$ $MPVE4QBOOFS $MPVE1VC4VC ($11SPKFDU" $MPVE4QBOOFS ($11SPKFDU#
  27. ,VCFSOFUFT w(,&্ͷ,VCFSOFUFTͰ*OHSFTTΛ࡞੒͢Δͱ$MPVE-PBE #BMBODJOH (-# ͕࡞੒͞ΕΔ w"1*(BUFXBZͷ*OHSFTTͱͯ͠࡞੒ w(-#͕'BTUMZͷΦϦδϯ w'BTUMZΦϦδϯؒ͸)5514Ͱ௨৴ w)5514ͷڧ੍΍*1੍ݶɺϔομͷઃఆΛ'BTUMZͰߦͳ͏

  28. ·ͱΊ w'BTUMZʹ͸ӡ༻Λࢧ͑Δ༷ʑͳٕज़͕͋Δ w5FSSBGPSNQSPWJEFS w%BUBEPH*OUFHSBUJPO w#JH2VFSZ΁ͷϦΞϧλΠϜϩάετϦʔϛϯά wΩϟογϡύʔδ wΫϥΠΞϯτ͔ΒͷશͯͷϦΫΤετͰ'BTUMZΛ׆༻͍ͯ͠Δ w"1* w੩తϑΝΠϧ