Often I find on GTMetrix that sites have too many DOM elements on the page and of course GTMetrix is very kind to suggest that we should simplify our code to make sure there is a very contained number of the same.
However in cases where you part-develop a site and part-integrate commercial software, not to mention self-generated dynamic code, in large projects this has managed to get a bit of of control in one of my existing projects. Now, if I had known about this before I would have started to pay attention to it since the start. However, I have only found out too late.
What I am not looking for, instead of rewriting and optimizing several thosand lines of code (tens of thousands?) is a "magical solution" - something like a RUNTIME DOM OPTIMIZER in php - that might save my skin and lighten the page and get a better GTMetrix and Google Pagespeed rating. Is there anything at all that might help? Any tricks, clever ideas, commercial software, freeware, custom scripts... basically anything is welcome as long as it helps.
In future I will be a good boy and try to do my homework but this once I need a quick fix...
P.S. By the way my site is in Opencart and Wordpress