How to minimize DOM Size when customizing the theme?

How to minimize DOM Size when customizing the theme?

CHUNG_YAN_NG
Tourist
10 0 1

Hello, 

 

I would like to know:

 

1. For every time when I customize the theme, will the DOM become bigger?

2. For example If I customize header and footer separately, will the DOM be larger than I customize&save them in 1 time?

3.Does it means that I better to customize the theme and save the setting at less as I can, to minimize the DOM ?

Replies 2 (2)

Stacy_Zhuk
Shopify Partner
520 22 72

Hello @CHUNG_YAN_NG,

 

If your theme increases the DOM structure each time you click "save" on its customization - then it means something is very wrong with this theme.
If you just edit theme code files - then it shouldn't affect the DOM except you are adding more elements.

 

Best regards,
Anastasia

Co-founder at Whidegroup, e-commerce development company from Ukraine
- 10+ years of experience with SMBs
- Deep expertise in custom development & optimization
E-mail: anastasia@whidegroup.com

oreoorbitz
Shopify Partner
261 31 133

1. Yes and no, it depends on the theme and any apps you have.

more you content on your page, bigger the DOM size, simple as that.

Sometimes apps will load tons and tons of HTML code that will increase your total DOM size. I tested this once with a popup app. I removed all content from the page, but the DOM size was still large, the popup app accounted for 50% of my total DOM size.

Available for pagespeed consulting
https://www.upwork.com/freelancers/~01a19b6cd90193f4f6?viewMode=1&s=1017484851352698949