Duplicate code when inserting multiple equal sections

filisantillan
Shopify Partner
12 3 5

Hello everyone, good day. Working with the Dawn theme, I realized that when inserting a section more than once, the CSS code is duplicated. I understand that this happens because the section calls its own CSS and JavaScript.

theme-code-duplicated.png

My question is is this a serious performance problem or not? Especially in the sections that reuse certain components such as: price, card, list, etc.

And if someone has found a way to minimize the problem or fix it. It only occurs to me to have a global file that is called site-wide, but it would be calling potentially unused code.

 

 

 

 

Reply 1 (1)

modg
Visitor
1 0 0

I'm curious about this myself. I noticed they regularly do this in the Dawn theme with certain components, and as far as I can tell the stylesheet would be included multiple times on the page. I would assume if they do it in Dawn then it's considered okay?

 

Do Shopify optimise this with their CDN in any way, however? I can't find any documentation on this.