Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LGTM画像を配信する為のCDNを作成 #4

Merged
merged 3 commits into from
Mar 1, 2021

Conversation

keitakn
Copy link
Member

@keitakn keitakn commented Feb 22, 2021

issueURL

#3

関連URL

画像サーバーの動作確認用のURL

https://lgtm-images.lgtmeow.com/test/1.jpg
https://lgtm-images.lgtmeow.com/test/2.jpg
https://lgtm-images.lgtmeow.com/test/3.jpg
https://lgtm-images.lgtmeow.com/test/3.webp

Doneの定義

  • S3にアップロードした画像がCloudFrontで閲覧出来る状態になっている事

変更点概要

ACMの証明書とCloudFrontを追加。

以下のURLでテスト画像を用意し閲覧出来る事を確認。

https://lgtm-images.lgtmeow.com/test/1.jpg
https://lgtm-images.lgtmeow.com/test/2.jpg

webp形式の画像も問題なく配信出来ることを確認。

https://lgtm-images.lgtmeow.com/test/3.jpg (こっちが3.webpの元画像)

https://lgtm-images.lgtmeow.com/test/3.webp

補足情報

webpへの変換は以下のブログを参考に行った。
https://blog.ideamans.com/2020/08/webp-params-2020.html

手順としては以下を実行するだけ。

// `3.jpg` が変換元の画像ファイルパスを指定し `3.webp` はファイル名を指定する。
cwebp -q 75 -metadata icc -sharp_yuv -o 3.webp 3.jpg

cwebp に関しては こちらの手順 でインストール可能。

元々1.4MBあった画像が363KBまで落ちているので、配信フォーマットを .webp 形式にするのは一定の効果がありそう。

sizemin

@keitakn keitakn self-assigned this Feb 22, 2021
Base automatically changed from feature/issue1 to main February 22, 2021 14:53
@keitakn keitakn changed the title 初期リリースに必要なフロントエンド用リソース作成 LGTM画像を配信する為のCDNを作成 Feb 24, 2021
Comment on lines +1 to +15
output "ap_northeast_1_main_domain_acm_arn" {
value = module.ap_northeast_1_acm.main_domain_acm_arn
}

output "ap_northeast_1_sub_domain_acm_arn" {
value = module.ap_northeast_1_acm.sub_domain_acm_arn
}

output "us_east_1_main_domain_acm_arn" {
value = module.us_east_1_acm.main_domain_acm_arn
}

output "us_east_1_sub_domain_acm_arn" {
value = module.us_east_1_acm.sub_domain_acm_arn
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

us_east_1_sub_domain_acm_arn のみ今回利用している、

ap_northeast_1_sub_domain_acm_arn は後でAPIサーバーが出来た際に利用するだろうけど、他はいらなかったかも・・・🐱

@keitakn keitakn marked this pull request as ready for review February 24, 2021 09:12
Copy link
Member

@kobayashi-m42 kobayashi-m42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webp での動作確認もありがとう!
LGTM

@keitakn keitakn merged commit cdb10a4 into main Mar 1, 2021
@keitakn keitakn deleted the feature/issue3/add-images-cdn branch March 1, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants