Enhancing Performance with On-Demand CSS Loading in Flynt Theme #570
Replies: 3 comments 3 replies
-
@rajpatel2435 we discussed this topic in detail internally and then decided to only create a css file instead of chunks, as we could not see any great advantage in terms of page speed in our tests and this file should be delivered from the local browser cache after the page is loaded for the first time. For some latest tests I created a branch some few weeks ago: master...Timo/SplittCSS This follows the idea to load one css file per component, only when a component is rendered. I would love to hear about your experiences with this approach. |
Beta Was this translation helpful? Give feedback.
-
Hi @timohubois Thanks for sharing that. I will implement that and see the performance and let you know I have another question can we apply gzip compression on images on production build as it is working for svg not for png webp and other formats. Can you throw some light on this, please? Thanks |
Beta Was this translation helpful? Give feedback.
-
Hey @timohubois I have seen some of the files are not compressing while production build as you see in the attached images. For this reason, I want to enabled the gzip compression in flynt itself while in production build. Thanks |
Beta Was this translation helpful? Give feedback.
-
Hey team, @timohubois @aaronmeder
I wanted to propose an idea to improve performance in our Flynt theme projects: implementing on-demand CSS loading. By dynamically loading CSS files only when they are needed, we can reduce the initial page load time and enhance overall user experience.
Key Points for Discussion:
2)Code Splitting: Integrating with build tools like Webpack to load CSS files on-demand based on specific JavaScript modules or routes.
Considerations: Address potential issues like Flash of Unstyled Content (FOUC) and ensure that critical CSS is still loaded initially to avoid rendering problems.
I'd love to hear your thoughts on this approach and discuss how we can implement it effectively in our Flynt theme projects.
Beta Was this translation helpful? Give feedback.
All reactions