tag-manager icon indicating copy to clipboard operation
tag-manager copied to clipboard

Improve container size by using parameter references instead of full variable content

Open ben-dw opened this issue 3 years ago • 3 comments

Hi everybody, I'm wondering how large a container file can get. In my case it is about 1 MegaByte! Using 100 tags and triggers and about 80 variables. I had a closer look into the container file and found out, that every tag using a variable includes the full variable content. For example: you use a matomo config variable for 50 tags, the same content of the variable is used 50 times. Each matomo config variable might have about 1.000 characters. 50 times X 1.000 characters = 50.000 characters = 50kb

image

How can we improve this? We should use IDs and reference it to each tag.

ben-dw avatar Jan 22 '21 11:01 ben-dw

Good point @ben-dw

We might not have realised this before or we just thought when using GZIP it shouldn't make a huge difference but it would still all need to be parsed etc. And I think there could be maybe potentially issues if the same variable is created multiple times but I don't think so. Generally, GZIPed the file be a lot smaller?

tsteur avatar Jan 24 '21 01:01 tsteur

GZIP makes a huge difference for sure. But not websites/server are configured correctly. In my case: actual site: about 1 MB transfered size (gzip): 70 kB

You are not able to create two variables with the same name. So there shouldn't be any potential issue.

ben-dw avatar Jan 25 '21 14:01 ben-dw

Thanks for checking @ben-dw 👍

tsteur avatar Jan 25 '21 21:01 tsteur