OctoDev Posted March 22, 2018 Posted March 22, 2018 Hello everyone! I've noticed that IPS, have always had so much white space in the source code? I suggest that the code will be optimized.This is not good for a huge premium software like IPS! The meta tags were also broken all the way till 4.3, but it's fixed. Hopefully, all that white space can also be fixed happens on all websites using IPS - unless they enable "HTML Minify" on CloudFlare. Screenshot: https://i.imgur.com/sOHMQ9G.png
evandixon Posted March 22, 2018 Posted March 22, 2018 The benefits of minifying the html are minimal when considering that it's being gzipped before being sent (at least, I think so, and I think I remember it working on my server, though I haven't checked in ages). There is a bit much whitespace though, as if it's being artificially added multiple times.
bfarber Posted March 22, 2018 Posted March 22, 2018 The HTML is compressed before being sent to the browser, so the amount of whitespace in the HTML source has virtually no impact on speed or SEO.
SeNioR- Posted March 22, 2018 Posted March 22, 2018 @bfarber is right. But not everyone has Gzip compression enabled, and for webmaster who manages the site, so many empty spaces are something that annoys him. Personally, I deleted empty spaces myself. Jimmy, I can create a plugin, if you want.
Adlago Posted March 22, 2018 Posted March 22, 2018 It really does not make sense. In version 4.2.7 I did this and I was able to remove about 700 bytes of source code. It took me a few days. The effect on load speed is as follows: almost zero ... Stupid exercise ...
SeNioR- Posted March 22, 2018 Posted March 22, 2018 1 hour ago, Adlago said: In version 4.2.7 I did this and I was able to remove about 700 bytes of source code. It took me a few days All you need is one string and you will delete all spaces in 1 min Here is my test: Before 108,734 bytes: After 96,058 bytes: Saved: 12,676 bytes
Adlago Posted March 22, 2018 Posted March 22, 2018 5 minutes ago, SeNioR- said: All you need is one string and you will delete all spaces in 1 min Here is my test: Before 108,734 bytes: After 96,058 bytes: Saved: 12,676 bytes Make a speed test before and after and share
OctoDev Posted March 23, 2018 Author Posted March 23, 2018 It's not always about SEO or Speed. It's about how it should be. I have never seen any other forum software, or websites in general that has that many empty lines. What is the reasoning behind this? I don't think there is any good explanation to why we should have extra lines in the source code. Maybe it doesn't make that much of an impact to load the page but still looks horrible. It just makes no sense, I've never seen any website have this other than IPS Forums. Sadly, think a plugin would be good for many but I personally enabled CloudFlare HTML Minify. I just think this is something that should be natively supported/optimized by IPS - no plugin required. For my case; you don't need to. But if any other here would want one, why not? Seems like IPS Are not going to support it, as "everyone has gzip enabled on their server, or use html minify so there is no reason to optimize it." 21 hours ago, bfarber said: The HTML is compressed before being sent to the browser, so the amount of whitespace in the HTML source has virtually no impact on speed or SEO. That really depends on your server configuration. I just don't see why you guys have added this much empty space to the "page source code". It looks horrible and unprofessional. Yes, it doesn't have much of an impact regardless if you enable gzip or whatever compression - but still looks pretty bad. This looks x10 better, and yes it saves some bandwidth.
opentype Posted March 23, 2018 Posted March 23, 2018 Not really seeing much logic in your argument. You claim to know how it “should be” and then “prove” that by saying nothing else than “others don’t do that”. That’s not much of an argument for the claim. And it isn’t even true. Quick check with Xenforo:
OctoDev Posted March 23, 2018 Author Posted March 23, 2018 1 hour ago, opentype said: Not really seeing much logic in your argument. You claim to know how it “should be” and then “prove” that by saying nothing else than “others don’t do that”. That’s not much of an argument for the claim. And it isn’t even true. Quick check with Xenforo: My deepest apologizes. I checked their main page, not the actual forum and you are right - they have it too. That means that IPS should also have lots of useless white space in the source code. I really do not understand why all that white space is even there, can anyone give me a quick explanation of the logic behind having so many new lines? I've understood this already: Everyone has GZIP enabled by default on their servers (Duh, no). There is not much of an impact (If your internet is really slow, those extra bytes matter). XenForo has it too (Okay? Still doesn't look professional to fill out the page with 10's of white space/lines that do absolutely nothing). Do these white lines actually do anything good at all? Beside looking unprofessional and adding extra data to the page. Looks messy.
bfarber Posted March 23, 2018 Posted March 23, 2018 We use a complex templating system to build the page output - we aren't generating static HTML files that can easily be manipulated. The template files have spaces and indentations in them for readability and ease of development purposes, and then when they are "put together" sometimes you see what you would consider extraneous space in the final output. It would actually consume more resources to strip those spaces, because we would need to write and execute code (at run time, on every single page load) to strip them. Spaces in HTML do not matter, and frankly 99.9% of your visitors are not looking at your HTML page source. GZIP negates any performance (speed or bandwidth savings) from stripping the HTML, so really the only reason left to do it is "because I look at the HTML source and think it looks prettier without extra spaces". By the way, here's the source code of apple.com
OctoDev Posted March 23, 2018 Author Posted March 23, 2018 8 minutes ago, bfarber said: We use a complex templating system to build the page output - we aren't generating static HTML files that can easily be manipulated. The template files have spaces and indentations in them for readability and ease of development purposes, and then when they are "put together" sometimes you see what you would consider extraneous space in the final output. It would actually consume more resources to strip those spaces, because we would need to write and execute code (at run time, on every single page load) to strip them. Spaces in HTML do not matter, and frankly 99.9% of your visitors are not looking at your HTML page source. GZIP negates any performance (speed or bandwidth savings) from stripping the HTML, so really the only reason left to do it is "because I look at the HTML source and think it looks prettier without extra spaces". By the way, here's the source code of apple.com I must admit, I've been living in a nutshell. I've only taken the initiative to look at my own forum, but when you mention it - I notice more and more websites have this. It's just, odd. The only reason why I did take a look at it, was because the meta tags were broken on 4.2 but fixed in 4.3, so I had to take a look and see why. Which was when I noticed the enormous use of new lines.
bfarber Posted March 23, 2018 Posted March 23, 2018 To be clear, we are not opposed to targeted clean up - for example, we've cleaned up the meta 'description' tag a bit for 4.3 (to allow longer descriptions, but also to clean up the spacing and special characters in the value). As for the rest of the HTML source code, however, you will generally use more resources to strip the space, and it doesn't net you any real benefits at the end of the day, so it's just not worth it. I've been investigating support for brotli page compression (not for 4.3, however) which would likely be a better solution to the concern than spending time writing algorithms to strip the spaces in the page source. If this is a big concern for you regardless, you could always use Tidy in PHP to clean the output (note that it adds overhead by its nature).
OctoDev Posted March 23, 2018 Author Posted March 23, 2018 36 minutes ago, bfarber said: To be clear, we are not opposed to targeted clean up - for example, we've cleaned up the meta 'description' tag a bit for 4.3 (to allow longer descriptions, but also to clean up the spacing and special characters in the value). As for the rest of the HTML source code, however, you will generally use more resources to strip the space, and it doesn't net you any real benefits at the end of the day, so it's just not worth it. I've been investigating support for brotli page compression (not for 4.3, however) which would likely be a better solution to the concern than spending time writing algorithms to strip the spaces in the page source. If this is a big concern for you regardless, you could always use Tidy in PHP to clean the output (note that it adds overhead by its nature). It's more my OCD. I solved this issue by enabling HTML minify in CloudFlare.
SeNioR- Posted March 23, 2018 Posted March 23, 2018 @bfarber So it is not worth using compression HTML by myself when GZIP is ON because it's even more harmful? @Jimmy Gavekort So you can turn off HTML minify in CloudFlare.
Ryan Ashbrook Posted March 23, 2018 Posted March 23, 2018 I would be very cautious about third party compression services - sometimes they can be a little overzealous and actually break functionality.
silenceheaven Posted March 23, 2018 Posted March 23, 2018 What about a JS combiner or something like AMD for all the files that stack up on a website.
SeNioR- Posted March 23, 2018 Posted March 23, 2018 39 minutes ago, silenceheaven said: What about a JS combiner or something like AMD for all the files that stack up on a website. This is another thing to do. But I don't know if this is possible because IPS has a lot of JS files and each of them is needed for something else. But that such optymalize would be great???
silenceheaven Posted March 23, 2018 Posted March 23, 2018 Just now, SeNioR- said: This is another thing to do. But I don't know if this is possible because IPS has a lot of JS files and each of them is needed for something else. But such optimization would be useful ??? At the very least, a way within applications to have your JS/CSS files combined together without a hacky solution, since having 10 addons with a bunch of styles/scripts gets big quick.
SeNioR- Posted March 23, 2018 Posted March 23, 2018 @silenceheaven Personally, I think that one large CSS file is better than a few smaller ones. Basically.. in IPS there are no small output files, there are only those "big". ?? I know that it depends what is best in case by case basis, what kind of site we are and how we are built it. But in IPS, we edit CSS / JS in ACP so...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.