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

HTTPレイヤーで行うパフォーマンスチューニング (WEBエンジニア勉強会 #05)

OSCA
February 02, 2018

HTTPレイヤーで行うパフォーマンスチューニング (WEBエンジニア勉強会 #05)

OSCA

February 02, 2018
Tweet

More Decks by OSCA

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ © OSCA 04$"ᖛ໺ Ұೋࡾ ͸·ͷ ͔ͣ;Έ ϓϩδΣΫτϚωʔδϟʔ ໷ܠࣸਅՈ 

    +BWB 1)1ϝΠϯͷ8&#ΤϯδχΞ  ਓ޻஌ೳ "* ؔ࿈΋΍ͬͯΔ  ݸਓͰ΋714आΓͯ8&#αʔϏεΛӡӦத  ເͷࠃ ెาݍ಺ॅΈ  !FOHJOFFS@PTDB !PTDBQIPUP!EJTOFZ@PTDB
  2. © OSCA • ͸͡Ίʹ • ίϯςϯπΛϒϥ΢βΩϟογϡͤ͞Δ ֓ཁ • )551௨৴ѹॖΛ͢Δ ֓ཁ

    • ίϯςϯπΛϒϥ΢βΩϟογϡͤ͞Δ ࣮ԋ • )551௨৴ѹॖΛ͢Δ ࣮ԋ • "QBDIFIUUQE ʹ͓͚Δઃఆ • OHJOY ʹ͓͚Δઃఆ • ϓϩάϥϜ͔Βར༻͢Δ)551ΫϥΠΞϯτʹ͍ͭͯ • ·ͱΊ ໨࣍
  3. © OSCA ίϯςϯπΛϒϥ΢βΩϟογϡͤ͞Δ BCDQOH ͪΐ͏͍ͩʂ BCDQOH ͪΐ͏͍ͩʂ BCDQOH ͪΐ͏͍ͩʂ BCDQOH

    ͪΐ͏͍ͩʂ ೥݄೔·Ͱ͸ɺ ͜ΕΛ࢖ͬͯʂ ͠͹Β͘ߋ৽͕ͳͦ͞͏ͳಉҰίϯςϯπ΁ͷΞΫηεΛݮ Β͠ɺΩϟογϡΛར༻ͤ͞Δ͜ͱͰදࣔΛߴ଎Խͤ͞Δɻ ΫϥΠΞϯτ αʔόʔ
  4. © OSCA )5.- $44 +BWB4DSJQU 9.- +40/ͳͲͷςΩετ ϑΝΠϧΛѹॖͯ͠ड৴͢Δɻ ड৴σʔλྔ͕ݮΓɺߴ଎ ʹͳΔɻ

    ͨͩ͠ɺΫϥΠΞϯτͱαʔόʔͷ྆ํ͕ɺಉ͡ѹॖܗࣜΛ αϙʔτ͍ͯ͠Δඞཁ͕͋Δɻ ͦ͜Ͱɺ"DDFQU&ODPEJOH ϔομͱ$POUFOU&ODPEJOH ϔομΛར༻͢Δɻ )551௨৴ѹॖΛ͢Δ
  5. © OSCA )551௨৴ѹॖΛ͢Δ αʔόʔ ϒϥ΢β ΫϥΠΞϯτ GET /index.html HTTP/1.1 Host:

    www.hogemoge.co.jp Accept-Encoding: gzip, deflate HTTP1.1 200 OK Content-Encoding: gzip (HTML)
  6. © OSCA ϒϥ΢βΩϟογϡ • NPE@FYQJSFT ϞδϡʔϧͷಡࠐΈ͕ඞཁ • ྫ 1/(ը૾ͷϒϥ΢βΩϟογϡظؒΛϲ݄ʹઃఆ "QBDIFIUUQE

    ʹ͓͚Δઃఆ LoadModule expires_module modules/mod_expires.so <ifModule mod_expires.c> ExpiresActive On ExpiresByType image/png "access plus 1 month" </ifModule>
  7. © OSCA )551ѹॖ • H[JQѹॖ͸ NPE@EFGMBUF ϞδϡʔϧͷಡࠐΈ͕ඞཁ • ྫ ςΩετ

    )5.- $44 +BWB4DSJQUΛѹॖ͢Δ "QBDIFIUUQE ʹ͓͚Δઃఆ LoadModule deflate_module modules/mod_deflate.so <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript </IfModule>
  8. © OSCA ϓϩάϥϜதͰ +40/΍ 9.-ͳͲ"1*Λݺͼग़͢͜ͱ͕ ͋Δͱࢥ͍·͢ɻ ͦͷࡍʹ)551ѹॖͬͯؾʹ͍ͯ͠·͢ ͔ʁ ݴޠඪ४ͷωοτϫʔΫܥΫϥεɾؔ਺Λར༻͢Δ৔߹ɺࣗ ෼Ͱ

    $POUFOU&ODPEJOHϔομΛ൑அͯ͠ղౚ͠ͳ͍ͱ͍ ͚ͳ͍৔߹͕ଟ͍͕ɺߴػೳͳ)551$MJFOUϥΠϒϥϦΛར ༻͢Ε͹ɺ)551ѹॖͷ෦෼΋Ӆṭͯ͠΍ͬͯ͘ΕΔ৔߹͕ ͋Δɻ ϓϩάϥϜ͔Βར༻͢Δ)551ΫϥΠΞϯτ