0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

静的配信の高速化:S3とCloudFrontの最適な分担

0
Posted at

はじめに

静的Webサイトやコンテンツの配信は、ユーザーに高速で安定したサービスを提供する上で重要です。Amazon Web Services (AWS) では、S3 (Simple Storage Service) と CloudFront を組み合わせて静的配信を実現することができます。この記事では、S3 と CloudFront の分担について説明し、最適な設定を探ります。

S3 とは

S3 は、AWS が提供するオブジェクトストレージサービスです。ファイルやデータを保存して、Web でアクセスできるようにすることができます。S3 には、データの耐久性と可用性が高く、多くの開発者や企業が利用しています。

CloudFront とは

CloudFront は、AWS が提供するコンテンツ配信ネットワーク (CDN) サービスです。Edge ロケーションと呼ばれる多数のサーバーが世界中に配置されており、ユーザーに近い場所からコンテンツを配信することができます。これにより、ユーザーへの配信が高速化され、Web サイトのパフォーマンスが向上します。

S3 と CloudFront の分担

S3 と CloudFront を組み合わせて静的配信を実現する場合、以下のような分担ができます。

  • S3: 静的コンテンツ (HTML、CSS、JavaScript、画像など) を保存しておく。
  • CloudFront: S3 に保存されたコンテンツを、Edge ロケーションからユーザーに配信する。

以下は、S3 と CloudFront を設定するための簡単な例です。

# S3 バケットを作成
aws s3 mb s3://example-bucket

# 静的コンテンツを S3 にアップロード
aws s3 cp index.html s3://example-bucket/

# CloudFront ディストリビューションを作成
aws cloudfront create-distribution --origin-domain-name example-bucket.s3.amazonaws.com

まとめ

S3 と CloudFront を組み合わせて静的配信を実現することができます。S3 に静的コンテンツを保存しておき、CloudFront で Edge ロケーションからユーザーに配信することで、高速で安定したサービスを提供することができます。詳しい手順はこちら → https://felixstudio0.gumroad.com/?utm_source=qiita&utm_medium=github_actions&utm_campaign=2026-q1&utm_content=qiita-footer

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?