XF 2.0 White Space ?

webbouk

Well-known member
I was always of the impression that 'white space' in rendered html caused the page to take longer to load as the user's browser reads through the lines.

Just viewing the source code of this page shows in excess of 2,000 lines and yet there is a lot of white space between the lines., which seems typical of all the xenForo pages when rendered

Does white space still have a part to play in page loading speeds or are modern browsers capable of skipping through it?
And if it does, is it possible to optimise pages when downloaded to remove it?
 
I could be wrong, but I imagine the minuscule amount of time you would save client-side would be offset by the extra time required to collapse white-space server-side, and any net gain would be negligible at best.
 
Why the huge gaps exist should be investigated. Also it feels like templates/styles are super heavy in general. I have some threads pages that are 8000+ lines of code. I was looking at bestbuy source code and they are around 500 on many pages. Even with threads with 1-2 posts, the framework is so heavy that only a couple dozen of lines are unique to that page.
 



 
Why the huge gaps exist should be investigated.
It's because of template syntax (like conditionals), and it's pretty much to be expected.

I was looking at bestbuy source code and they are around 500 on many pages.
I'm impressed they managed to make their website feel so clunky in only 500 lines. Comparatively, XF feels a lot lighter, at least to me. In fact, if I pretty-print the Best Buy source, it comes in around 21k lines (69kb) (whereas XF comes in at around 5k lines/24kb). If XF compressed the output as heavily as they did, I imagine it'd be far smaller, but it wouldn't really be any faster.
 
Top Bottom