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

Webサービスにおける
キャッシュ戦略

 Webサービスにおける
キャッシュ戦略

YAPC::Asia Hachioji 2016 mid in Shinagawa
2016-07-03
Yusuke Wada a.k.a. yusukebe

Yusuke Wada

July 03, 2016
Tweet

More Decks by Yusuke Wada

Other Decks in Technology

Transcript

  1. DBDIF͸े෼ʹ଎͍ҽӒҶనᝢ w ΩϟογϡετΞͷ୅දྫ w NFNDBDIFE w 3FEJT w ΞϓϦέʔγϣϯϝϞϦ w

    ϑΝΠϧFUD w ,74ΠϯλʔϑΣʔεΛར༻͠*0Λޮ཰Խ͢Δ w ࠓճ͸ओʹNFNDBDIFEΛ૝ఆͯ͠࿩͠·͢
  2. DBDIFTFU LFZ WBMVF     
 NZWDBDIFHFU LFZ

     σʔλΛอ࣋͢Δ༗ޮظݶΛ ࢦఆग़དྷΔ
  3. TVCHFU@OFXT@FOUSJFT\ NZTFMGTIJGU NZFOUSJFTTFMGDBDIFHFU LFZ  SFUVSOFOUSJFTJGFOUSJFT FOUSJFTTFMGGFUDI@OFXT@FOUSJFT  TFMGDBDIFTFU LFZ

    FOUSJFT   SFUVSOFOUSJFT ^ LFZʹWBMVF͕ଘࡏ͢Δ͔HFUͰ֬ೝ͢Δ WBMVF͕ଘࡏͨ͠Βͦͷ··ฦ͢ ଘࡏ͠ͳ͍৔߹)551ϦΫΤετΛ૸ΒͤίϯςϯπΛੜ੒ FYQJSFΛࢦఆͯ͠LFZͰίϯςϯπΛTFU͢Δ ίϯςϯπΛฦ٫͢Δ
  4. TVC@CVJME@DBDIF@LFZ\ NZ DMBTT TUPSBHF BSHT BUUST !@ NZSFGTUPSBHF@TFMFDU@BSHT@UP@RVFSZ  !\BSHT^<>

    BUUST   NZDPOO  SFUVSO%JHFTU4)"TIB@IFY  4UPSBCMFOGSFF[F  <SFG DPOO\/BNF^ DPOO\6TFSOBNF^]]>   ^ ౎౓ͷΫΤϦ΍ίωΫγϣϯ৘ใͳͲΛ
 ϋογϡؔ਺΁௨ͯ͠จࣈྻԽͨ͠΋ͷΛLFZͱ͍ͯ͠Δ
  5. TFMGECTFBSDI FOUSZ  \VTFS@JE^  \PSEFS@CZJE FYQJSF ^  Ԡ༻͢Ε͹൒ಁաతΩϟογϡػߏ͕࡞ΕΔ

    FYQJSFͱ͍͏໊લͷϋογϡ஋Λઃఆ͢Δͱࣗಈతʹ ͦͷ͚࣌ؒͩΩϟογϡ͓͍ͯͯ͘͠ΕΔͱ͔ ͨͩ͠%#ଆͷߋ৽ͷ൓ө͸FYQJSFͨ͠ޙʹ͞ΕΔΑʂ
  6. Ωϟογϡ͸ॾਕͷ݋ w DBDIF΁ͷ,74ΠϯλʔϑΣʔε͸े෼ʹ଎͍ w Ωϟογϡͷߋ৽ʹ͸ؾΛ࢖Θͳͯ͘͸͍͚ͳ͍ w FYQJSF·Ͱͷظ͕ؒ࢓্༷ແ೉Ͱ͋Δ w ҙਤతʹΩϟογϡΛEFMFUF͢Δ w

    LFZͷ໊෇͚Λ໌ࣔతʹ΍Δ͔ಁաతʹߦ͏͔ʁ w ͳΔ΂͘ϑϩϯτدΓͰΩϟογϡͤͨ͞ํ͕ߴ଎ w ͱ͸͍͑ΞϓϦέʔγϣϯͷมߋʹऑ͍
  7. #PLFUFεϖοΫ w ೥݄ϩʔϯν w ΋͏͙͢ສ%- J04 "OESPJE  w Ϙέ

    ສ݅ w ͓୊ສ݅ w ධՁԯ݅ w ϐʔΫ࣌SFRTTFD
  8. #PLFUF%# QBDLBHF#PLFUF%# VTFQBSFOU5FOH  TVCGJOE@XJUI@DBDIF\ NZ TFMG UBCMF XIFSF FYQJSF

    !@ NZLFZTFMGNBLF@LFZ UBCMF XIFSF GJOE  NZEBUBTFMGDBDIFHFU LFZ  SFUVSOEBUBJGEBUB NZPCKFDUTFMGTJOHMF UBCMF XIFSF  PSSFUVSO EBUBPCKFDUJOGMBUF@DPMVNOT  TFMGDBDIFTFU LFZ EBUB FYQJSF  SFUVSOEBUB ^ TVCEFMFUF@DBDIF\ ൒ಁաΩϟογϡ ΠϯλʔϑΣʔεΛੜ΍͢
  9. #PLFUF%#3PX#PLF QBDLBHF#PLFUF%#3PX#PLF  TVCJOGMBUF@DPMVNOT\ NZTFMGTIJGU NZEBUBTFMGDPMVNOT  EBUB\PEBJ^ TFMGIBOEMFGJOE@XJUI@DBDIF 

    PEBJ \JEEBUB\PEBJ@JE^^    SFUVSOEBUB ^ औಘ࣌ʹϦϨʔγϣϯઌͷ ΦϒδΣΫτΛΩϟογϡ͢Δ
  10. !CPLFTTFMGECTFBSDI CPLF \^ \PSEFS@CZ \JEBTD MJNJU^^  CPLFT<>\PEBJ^\QIPUP^\MBSHF@VSM^ .Z42-4&-&5$5 '30.CPLF03%&3#:JE"4$-*.*5

    NFNDBDIFEHFUPEBJBCDEFG NFNDBDIFEHFUQIPUPBCDEFG NFNDBDIFEHFUPEBJBCDEFGH NFNDBDIFEHFUQIPUPBCDEFGH  NFNDBDIFE͔ΒͷHFUͳͷͰे෼ʹ଎͍ 3%#.4΁ͷෛՙ͸ΫΤϦҰൃͷΈ
  11. ൒ಁաతΩϟογϡΛ࠾༻ w ϞσϧʹDPOE BUUSΛҾ਺ͱͯ͠΋Β͏ϝιο υΛੜ΍͢ྫHFU@TPSUFE@FOUSJFT  w BUUSͷϋογϡʹFYQJSFͷ஋͕ೖ͍ͬͯΕ͹ͦͷؒ ͚ͩΩϟογϡͤ͞ΕΔ NZTFMG

    DPOE BUUS!@  TFMGECTFBSDI CPLF \^ \PSEFS@CZ\SBUF@TVN EFTD MJNJU FYQJSFBUUS\FYQJSF^^^ 
  12. ࢓૊Έ w ௨ৗͷΩϟογϡ &YQJSF͕୹͍Ωϟογϡ w ্ه̎ͭΛNFNDBDIFEʹTFU w HFU࣌ʹͱ͋Δ֬཰Ͱ&YQJSF͕୹͍ํͷΩϟογϡ Λݟʹ͍͘ w

    Ұఆͷ֬཰ͰΩϟογϡ͕ૣ͘੾ΕΔ w Ұ౓ʹίϯςϯπ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