AmazonCloudFrontで始めるお手軽簡単CDN

 AmazonCloudFrontで始めるお手軽簡単CDN

あなたのWebサイトも月◯◯円で爆速化できちゃうかも?

C47bda32c8455a59471cd7e19c32c074?s=128

濱田孝治

April 19, 2018
Tweet

Transcript

  1. 1 2 A 4 41 8/0 9 A

  2. 2 70 • 1 • 9 I • @ 2

    • 
  3. 4   

  4. 5    1 → 3 32 ↑

  5. 6    1 → 3 1 → 5

    1 → 6 32 ↑ 90 ↑ 106%↑
  6. 7    1 → 3 1 → 5

    1 → 6 1 → 7 1 → 10 32 ↑ 90 ↑ 106%↑ 113%↑ 123%↑
  7. 8  Web   X   Y New

    Industry Benchmarks for Mobile Page Speed - Think With Google https://www.thinkwithgoogle.com/marketing-resources/data-measurement/mobile-page-speed-new-industry-benchmarks/
  8. 9    1 3   32% 

      1 5   90%    1 6   106%    1 7   113%    1 10   123% 
  9. 10 

  10. 10  "   !

  11. 11    ! Web  

  12. 12   C F D

  13. 13  l C l l CA l F l

    C l C
  14. 14 Web 

  15. 15 Web   1.   

  16. 16 Web   1.   

  17. 17 Web  1.   2.   

  18. 18 Web  1.   2.   

    
  19. 19 Web  1.    2.  

    3.    
  20. 21 Web  1.    2.  

    3.     
  21. 22 Web   1.    2. 

     3.   ! !  
  22. 23       

  23. 24 Web Client Internet Web App Database

  24. 25    Client Internet Web App Database •

       • Akamai •CloudFront •Cloud Flare • Nginx • Apache mod_cache • APCphp • API Gateway response cache • Amazon ElastiCache • redis • Memcached • Amazon DynamoDB Accelerator DAX
  25. 26 AWSConsole Amazon CloudFront Edge   

  26. 27 CDN  CloudFront 

  27. 28 CDN     CloudFront

  28. 29 CDN ! $"%    #  CloudFront

    &
  29. 30 Web   1.    2. 

     3.   ! !  
  30. 31 Web   1.    2. 

     3.   ! !   AmazonCloudFront
  31. 32 Amazon CloudFront

  32. 33 Amazon Cloud Front + Contents Delivery Network)CDN* % %

    ( ! "# $' &
  33. 34 %"Contents Delivery Network • Akamai •   &

    CDN $ • CloudFlare • !CDN  WordPress#   • Google Cloud CDN • GCP CDN 
  34. 35 AmazonCloudFront41 .:2  '7(   36*58=;%%<),9 CloudFront #%&

    ClientA ClientB ②%%+0 ③<) ①# ④# ⑤ ! <) '7($&"%/-
  35. 36 AmazonCloudFront&" ClientA ①  DNS )$ DB '%+ *!

    ②IP  ,xxx.cloudfront.net- )$ DB DNS ③%+Edge #( ④%+Edge  CloudFront
  36. 37 AmazonCloudFront 2456 114 

  37. 38 

  38. 39 CloudFront  ① EC2    ② EC21RDS

        ③ EC2RDS    
  39. 40  ① ①EC2   

  40. 41 ① CloudFront  Client Route 53 www.example.com  EC2

    ELB
  41. 42 4-)① CloudFront4-5B+2C Client Route 53 www.example.com A<(#(" EC2 ELB

    CloudFront '( 3   (#(". CloudFront %!& → D1*@ CloudFront!%!&) $A<(#("?, /;67> EC2D0:8  10  9=
  42. 43 ;52#① CloudFront;5<QH8R Client Route 53 www.example.com OG 1(1' CloudFront

    CloudFront OG 1(1' .&"/:B !$ AN6E>P S3OG+0,#(17? @9 S3 OG+06E>PS3 IL *+2-1#MD Q3F4%#  !)R=JCloudFront;5CK 
  43. 44   ② ②EC2RDS     

  44. 45 ② CloudFront  Client Route 53 www.example.com  ELB

    EC2 RDS
  45. 46 0)%② CloudFront0)1 Client Route 53 www.example.com +7$$ ELB EC2

    RDS CloudFront=7%+7% &;  !   !8/ .5 >1:? CloudFront #%"$4( 2< 329CloudFront %$4-*6 ',
  46. 47   ③ ③EC2RDS     

  47. 48  ③ CloudFront Client Route 53 www.example.com  

    ELB App RDS App App img  wp- content/uploads/ NFS  EC2  
  48. 49 0)&③ CloudFront0)1 CloudFront Client :6%% *6%% ELB EC2 RDS

    php jpg png js css Route 53 www.example.com S3 :6%% 5( $ S337 #&!%- 2 + *6%% " & 9/8. 4 ,'
  49. 50 ③ • WordPress& S3 #(!"$ • %  )StaticPress

    S3 WP Offload S3 Lite* • goofys'Linux→S3   %
  50. 51 '! ③ CloudFront'!( CloudFront Client /, $, ELB EC2

    RDS S3 Route 53 www.example.com     2  S3Bucket +  UploadsC S S  JavaScript ◯ /wp-includes /wp-content Custom Origin WordPress*) $, HTML  △0.#,1 /login.php /wp-admin Default(*) CloudFront-%"&
  51. 52   

  52. 53 • CDN $%C 9 />KH • GET/HEAD/OPTION (<I •

    URLB $%@L=;8F • +-!&,AF 6E"-  J08F • Header / Cookie / Query Strings URL ?57 +-!&,AF '#-1 :2.G $%34D $%,*-)AF
  53. 54  %#&"*-31,%%4 •  + 2  0 TTL

    /( • HTTP&  !!% & $&  • . ')/( OK
  54. 55 *+2"03/BHO8F2!2 P • .23$ ; HeaderCookie Query Strings&13# 8F(3

    M5 ;> • URL%C G *+2"03/: H • Whitelist6E '.3,284 = I %-)3&13# * +@7DE • *+ 2!2 .2 J 5?L9 M5NK9A< 
  55. 56  )-1 ,2 • + . - Amazon CloudFront

    • https://aws.amazon.com/jp/cloudfront/dynamic- content/ • CloudFront    # %/$!1'(02 • https://docs.aws.amazon.com/ja_jp/AmazonCloudFro nt/latest/DeveloperGuide/Expiration.html • Amazon CloudFront (/   (2015"6&*) • https://dev.classmethod.jp/cloud/cloudfront-cache- control/
  56. 57 

  57. 58 5;4627>-=71? 5;8/ CloudFront< IP"' *< .,CloudFront   

    CloudFront Client +9(!( ELB EC2 RDS CloudFront$%!&)#:0  CloudFront IP"'*<13 
  58. 59 $ &#"1' CloudFront CloudFrontAWS WAF IP  % ELB

    EC2 RDS WAF IP  %  Client WAF ! 
  59. 60 4<3 526A.@6CB CloudFront Client CloudFront IP%9/1 ELB+  !#$(

    ;0 ELB EC2 RDS )7* &("'=:   IP%9/1 WAF ELB !#$( IP %,>? -8''
  60. 61 1;0 3/5=928?> CloudFront( ! $:,. WAF  ! $

    ELB < :, CloudFront Client *6## ELB EC2 RDS CloudFront( &) +27- ! $" ' % WAF WAF &) +4! $'%" ELB < WAF
  61. 62 CloudFront

  62. 63  https://aws.amazon.com/jp/cloudfront-cdn/

  63. 64  https://aws.amazon.com/jp/cloudfront-cdn/

  64. 65  https://classmethod.jp/services/members/

  65. 66  https://classmethod.jp/services/members/

  66. 66  https://classmethod.jp/services/members/

  67. 67 

  68. 68   • CDNCContents Delivery NetworkDWeb &?84/A7:<9; • Amazon

    CloudFront2<  @=- % -$  3=-%-$*#+ 6>    • , )"#')-(.!1 CloudFront   50 B