Feature Request: first request WebP, second request: AVIF
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- aws, typescript
調査の方向性
画像リクエストと CloudFront のレスポンスおよびキャッシュ設定を処理する TypeScript AWS Lambda エントリーポイントをまず見つけます。現在の AVIF 変換と If-None-Match の処理がどのように動作するかを追跡します。最初のリクエストで速やかに WebP を返せ、後続のリクエストで AVIF を生成でき、文書化された Cache-Control の動作がテストまたは検証でカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Background
Lamada takes long time to transform image to avif format.
Solution: Stale-While-Revalidate
stale-while-revalidate is a caching setting. It’s a parameter in the Cache-Control header, and it tells CDNs how long they can keep serving the image after it expires:
Cache-Control: max-age=3600, stale-while-revalidate=60
↑ how long a file can be cached for
↑ how long a CDN can keep serving
the file after max-age expires
Here’s how we used it to make sure AVIF never makes image responses slow:
- First Request: WebP
On the first request, we serve the image as WebP, not as AVIF.
We also set the Cache-Control header to max-age=0, stale-while-revalidate=31536000
-
Immediate Expiry
Because max-age is set to 0, the WebP image expires immediately. This prompts the CDN to forward the second request to us. -
Second Request: AVIF
When the second request arrives, we serve the image as AVIF.
Responding to the second request can take several seconds because AVIF conversion is slow. But thanks to stale-while-revalidate, our CDN (CloudFront) keeps serving the WebP image until the conversion is complete.
We recognize the second request from the first by the If-None-Match header. Only the second request has it.
When the AVIF image is ready, we return it with Cache-Control: max-age=31536000. This allows the CDN to cache and serve it for a long time.
- 主要言語
- TypeScript
- スター
- 276
- フォーク
- 151
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws-samples/image-optimization のほかの issue
-
CDK CLI and aws-cdk-lib version mismatch leads to deployment errors再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
bug wontfix
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
aws-samples/image-optimization#65 · コメント 1 件 ·
-
[Feature request] Supply original image from original S3 bucket再び着手できるかも @achrafsouk が 427 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
aws-samples/image-optimization#47 · コメント 1 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
aws-samples/image-optimization#33 · コメント 11 件 ·
aws-samples/image-optimization の issue をすべて見る
似ている issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
github/docs#46222 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent-ready area: config area: skills type: chore upstream: brain-kit
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
enhancement priority:low ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug escritorio mapa
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
marcosferr/reporte-ciudadano#4 · コメント 1 件 ·
-
area: material/sort gemini-triaged needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
angular/components#33933 ·
メンテナーはふだん 1 日以内に返信