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

商品一覧画面の商品画像を lazyload に対応 #4933

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

okazy
Copy link
Contributor

@okazy okazy commented Feb 19, 2021

概要(Overview・Refs Issue)

refs #4816

商品詳細画面の商品画像を lazyload に対応しました。

lazyload.mov

方針(Policy)

一旦効果が大きそうな商品詳細画面のみ対応しています。

実装に関する補足(Appendix)

Generator は他のプルリクで修正していただいていますので、変更から除外しました。

alt 属性もつけたかったが、商品名で良いのかの議論もあるのでいったん保留。

テスト(Test)

目視で確認

  • 商品数: 209個
  • ページあたりの商品数: 60個
  • Chrome, Firefox, Safari

ただし Safari は lazyload 非対応のため全画像読み込みとなった

Lighthouse で確認したところ、いくつかの警告が改善できていた。
スコアにはほとんど変化なかった。

相談(Discussion)

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更
  • フックポイントの呼び出しタイミングの変更
  • フックポイントのパラメータの削除・データ型の変更
  • twigファイルに渡しているパラメータの削除・データ型の変更
  • Serviceクラスの公開関数の、引数の削除・データ型の変更
  • 入出力ファイル(CSVなど)のフォーマット変更

レビュワー確認項目

  • 動作確認
  • コードレビュー
  • E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
  • 互換性が保持されているか
  • セキュリティ上の問題がないか

@okazy okazy changed the base branch from 4.0 to 4.1-feature February 19, 2021 09:10
@okazy okazy added affected:template フロントテンプレートの変更 enhancement 機能追加 labels Feb 19, 2021
@okazy okazy added this to the 4.1 milestone Feb 19, 2021
@okazy
Copy link
Contributor Author

okazy commented Mar 15, 2021

検証環境を固定するため、レンタルサーバに EC-CUBE をインストールし、 Lighthouse で計測しました。

環境

検証結果

概要

  • パフォーマンスのスコアとしてはあまり変化がありませんが、いくつか重要な警告が改善しています。

Lazyload なし

image

Lazyload あり

image

Opportunities

  • Properly size images が大幅に改善

Lazyload なし

image

Lazyload あり

image

Diagnostics

  • Serve static assets with an efficient cache policy107 resources found から 17 resources found に改善
  • Avoid enormous network payloads が改善
  • Minimize main-thread work が改善
  • Keep request counts low and transfer sizes small115 requests • 3,946 KiB から 25 requests • 1,225 KiB に改善

Lazyload なし

image

Lazyload あり

image

@chihiro-adachi
Copy link
Contributor

全体のスコア自体は大きく向上するわけではないが、各種指標で改善が見られるためマージしたいと思います。

@chihiro-adachi chihiro-adachi merged commit c46e77c into EC-CUBE:4.1-feature Mar 23, 2021
@chihiro-adachi
Copy link
Contributor

@okazy ありがとうございます、マージしました

@okazy okazy changed the title 商品詳細画面の商品画像を lazyload に対応 商品一覧画面の商品画像を lazyload に対応 Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected:template フロントテンプレートの変更 enhancement 機能追加 Status: ready-for-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants