-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix: change LCP image from png to webp #142
base: main
Are you sure you want to change the base?
Conversation
@Kyujenius is attempting to deploy a commit to the Toss Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
can you please add this to Chinese version?
Of course, I'm willing to do it! If you don't mind, may I ask why? |
We recently merged the PR for the Chinese version. It would be great if you could add this there as well. |
@milooy Extra: If you look within my PR, I'm asking if it's legally possible to define and add static css files that have been received through the network. I asked if it's possible to add them, is it possible? If possible, I will upload it within the evening :) |
Sorry for missing your question. Currently, Toss doesn't officially provide a static font file. Loading an async CSS file can cause layout shifts, so it might be better to explore alternative solutions. Let's make this slow FCP caused by web font problem as a known issue. I've created an issue to track this and will follow upon it soon. If you commit the change to use WebP for images in ch/index.md, I'll review it shortly! |
* chore: create ch files * docs: translate into simplified chinese * docs: translate into simplified chinese * docs: translate into simplified chinese * docs: translate into simplified chinese * docs: translate into simplified chinese * docs: translate into simplified chinese * refactor: substitute with suitable terms * docs: translate into simplified chinese * feat: add chSearch * fix: change chSearch option * fix: fix typo with inspection * �fix: fix typo in hidden-logic.md 同时 -> 同事 Co-authored-by: Jinyeong Seol <[email protected]> * feat: implement dark mode image support in markdown * docs: improve item-edit-modal.md by adding abstraction concepts * fix: correct localized link --------- Co-authored-by: Jinyeong Seol <[email protected]>
- The link was still redirecting to Yes24, so the link was updated properly
* Fix: Ensure Giscus supports Chinese * Fixed an issue where the Chinese locale was not applied in Giscus * Fix: Correct import path for Chinese locale * Fixed an incorrect import path in ( → ). * Revert: yarn.lock
* fix: Add missing 'from' keyword in import statement * fix: Add missing period in email validation error message(ko) * fix: add auth token to HTTP header
@milooy |
📝 Key Changes
This PR focuses on optimizing performance metrics, specifically First Contentful Paint (FCP) and Largest Contentful Paint (LCP), through various improvements. All of these analyses were analyzed by lighthouse in Chrome.
Initial Performance Issues
The current LCP file is the following image. It is ff-symbol-gradient.png
When using the current png file as it is
The site currently experiences suboptimal performance: FCP is around 2.6 seconds, it exceeds the ideal time of 1.8 seconds LCP is around 6 seconds, significantly higher than the recommended 2.5 secondsImplemented Optimizations
Converted ff-symbol-gradient.png to WebP format
Tested different quality settings (80%, 60%, 40%) to find optimal balance
Results showed improved performance metrics while maintaining visual quality
Even if the quality is only 80 percent, the performance benefits are sufficient.
Changing png to webp only reduces LCP by half. However, this does not solve the underlying problem.
Current problematic implementation:
If you comment out these two parts, the performance changes as follows
However, this approach has many issues as it simply removes the code without considering the side effects in the font usage.
A better method would be to bundle the CSS files within the project instead of loading them through the network.
Copy the static CSS that was previously loaded through the two links and define it internally as follows:
While it would work fine to save and use the downloaded CSS files in the public/fonts folder, this isn't included in this PR as it could raise legal issues. If it's acceptable, I'll add this in an additional commit. 🙂
After applying this change, we can observe the following performance metrics while maintaining the use of existing fonts..!
How about introducing the Slash library developed by Toss?
https://www.slash.page/ko/libraries/react/async-stylesheet/src/index.i18n
🖼️ Before and After Comparison
中文版
此PR主要通过各种改进来优化性能指标,特别是First Contentful Paint (FCP)和Largest Contentful Paint (LCP)。所有这些分析都是通过Chrome中的lighthouse进行的。
初始性能问题
当前的LCP文件是以下图片:ff-symbol-gradient.png
使用当前png文件时的情况
网站目前性能表现不佳: FCP约为2.6秒,超过了理想时间1.8秒 LCP约为6秒,远高于建议的2.5秒已实施的优化
将ff-symbol-gradient.png转换为WebP格式
测试了不同的质量设置(80%、60%、40%)以找到最佳平衡点
结果显示在保持视觉质量的同时改善了性能指标
即使质量只有80%,性能提升也已经足够。
将png更改为webp只能将LCP减少一半。然而,这并不能解决根本问题。
当前存在问题的实现:
如果注释掉这两部分,性能变化如下:
然而,这种方法存在许多问题,因为它只是简单地删除代码而没有考虑字体使用方面的副作用。
更好的方法是在项目内部打包CSS文件,而不是通过网络加载。
将之前通过两个链接加载的静态CSS复制下来,按照以下方式在内部定义:
虽然将下载的CSS文件保存在public/fonts文件夹中并使用是可行的,但由于可能涉及法律问题,这部分未包含在本PR中。如果可以接受的话,我会在后续提交中添加这部分内容。🙂
应用此更改后,我们可以在保持现有字体使用的同时观察到以下性能指标..!
考虑引入Toss开发的Slash库如何?
https://www.slash.page/ko/libraries/react/async-stylesheet/src/index.i18n
🖼️ Before and After Comparison