|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
I made a quick test and found [:red] 8341 extra white spaces (such as " ") in this page. It has a total of 9385 spaces, of which only 944 are needed at all. This turns into 4k of extra spaces per showflat file with at least 10 replies. The php/perl code for w3t looks great, anyone can go in and find what he wants to change. But do we really nead to have things like : [:blue] echo " </table></td></tr> <tr><td colspan=3 class="lighttable"> <p class="post"> <BR><BR><SPAN CLASS="post">$Body</span> <BR><BR> </td></tr><tr><td colspan=3 class="body"></td></tr> ";
when the following would be just as understandable?:
[:purple] echo " </table></td></tr> <tr><td colspan=3 class="lighttable"> <p class="post"> <BR><BR><SPAN CLASS="post">$Body</span> <BR><BR> </td></tr><tr><td colspan=3 class="body"></td></tr> ";
Oh, our cool html editors do that? I havent seen any recent html editor that doesnt allow you to turn this off. Check it! You will be saving download time for your site users!
Though I gave an example page, this happens at all generated pages...
Mateo Byler CruceDeCaminos.com
|
|
|
|
Joined: May 1999
Posts: 624
Master Hacker
|
Master Hacker
Joined: May 1999
Posts: 624 |
Let's keep the indented layout for easy readability/editablity in the distribution then we can remove the extra white space ourselves when we've finished our adjustments of our own copies. [] http://www.amdragon.com/images/eileensig.gif[/]
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
Do you really need it? Lately I´ve been designing without these indentations, and find its not hard to follow at all because nowdays all html code editors highlight with different colors the various codes, so its easy to follow anyways. It only makes sense to me if you are really using the windows notepad to edit the code. I find no problem of the indentation in the perl code, though, just the html part. Also, I took out the spaces of one file, and guess what: Its easier to find the html part you are looking for when this is not indented! Why? Because the perl/php code is indented as well, and when you see no indentation you know it is html. Plus: Simple calculation, per every 100 pages you send with this 4k save, you are saving your server of 400k bandwidth!Mateo Byler CruceDeCaminos.com
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
Oh, yes it would seem hard to follow the code as if you run an html compressor (as one I´ve seen commented at your site), because those compress the html even more. I would keep the line breaks for easy reading code, just the indentations removed. These compressors compress the pages to the point that all code is in only one line -no line breaks. Really ugly and hard to follow the code, I am not suggesting going that far... just indentation. Mateo Byler CruceDeCaminos.com
|
|
|
|
Joined: May 1999
Posts: 624
Master Hacker
|
Master Hacker
Joined: May 1999
Posts: 624 |
>>It only makes sense to me if you are really using the windows notepad to edit the code. Ah, but a lot of us DO! [] http://www.amdragon.com/images/eileensig.gif[/]
|
|
|
|
Joined: May 1999
Posts: 624
Master Hacker
|
Master Hacker
Joined: May 1999
Posts: 624 |
I'd like to keep the fully indented master version and then run my own edited copy through an html compressor before uploading to the server. That way I get the very best of both worlds. [] http://www.amdragon.com/images/eileensig.gif[/]
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
And that would become another upgrade nightmare for you..! If you compress your own then all pages will always show different from the newer version, uncompressed, and you´d have to check all files for the upgrades... I think you use Araxis Merge, right? well, it will show all files as changed, adding to your upgrade nighmare. You will have to check line after line to see if the difference is a bunch of spaces or a single ch aractor. If it is to be done it should be done to the main distributed version. Oh, and replace that useless notepad with something else such as UltraEdit or the freeware ConText! Mateo Byler CruceDeCaminos.com
|
|
|
|
Joined: May 1999
Posts: 624
Master Hacker
|
Master Hacker
Joined: May 1999
Posts: 624 |
Ummn. I was thinking of doing it on a copy actually - not my original but you still have a point. I actually use TextPad. []/w3timages/icons/smile.gif[/] [] http://www.amdragon.com/images/eileensig.gif[/]
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
A very good editer is one that is free but also can get a registerd copy for like 25 or 50 dollars... It is Lorenz Graf's HTMLtool 3.5e... located at <a href="http://www.lograf.com/">Lorenz Graph HTMLtool</a>
I use this what an awesome tool.. great for all codework (including perl!!!!)
ps can anyone get html to be enabled I went into my profile and it is not there... can't embed link... sorry []/w3timages/icons/frown.gif[/]
Regards,
Mike West
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
DOOHHHHH!!!!
Pulled a Homer!!!!
HaHa!!
Mike West
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
I don't know about the PHP version but the indents in the Perl code are VERY helpful. Perhaps a major source of unnecessary indents in html is w3t::open_table and w3t:close_table Darren. http://www.bullpen.com.au
|
|
|
|
Joined: Jan 2000
Posts: 111
Kahuna
|
Kahuna
Joined: Jan 2000
Posts: 111 |
Hey, thanks for the tip on ConTEXT! Screen shots looked so good, I'm downloading it as I write this... []/w3timages/icons/smile.gif[/] P.S.: I'm afraid the install failed on my machine... some module exception error... Edited by Gerrit on 12/30/00 04:18 AM (server time).
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
>I don't know about the PHP version but the indents in the Perl code are VERY helpful. >Perhaps a major source of unnecessary indents in html is w3t::open_table and w3t:close_table Yes, I agree it is helpful in the perl/php code. I like it as well. I´d keep using it in this section, but whenever there is a print action where you insert html code I would get rid of the extra white spaces. So my point is: use indentation for the perl/php part, dont use it for the html part. []/w3timages/icons/crazy.gif[/] Mateo Byler CruceDeCaminos.com
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
I get lots of complaint about sluggishness and slowness of the board, so this unnecessary crap is the reason why!!!! Additionally, most people pay traffic surcharges for the server!!
<a href = "http://www.angeles2.com/board/wwwthreads.pl?Cat=&C=1">Angeles City Messages</a> this is so unnecessary listing the domain name 100 times per page, the following would be enought <a href = "wwwthreads.pl?Cat=&C=1">Angeles City Messages</a>
<a href="http://www.angeles2.com/board/postlist.pl?Cat=&Board=angeles2&page=0&view=expanded&sb=3
could be <a href="postlist.pl?B=angeles2&p=0&v=exp&sb=3
|
|
|
|
Joined: Jul 1999
Posts: 118
Enthusiast
|
Enthusiast
Joined: Jul 1999
Posts: 118 |
please, how do I compress the .pl files so that the unnecessary spaces are taken out without screwing up the perl code????
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
The only safe way is manually, you only need (if you want to do so) to take out the white spaces out of the html part, leaving the perl part of the code intact. But in some places it is needed. You can start out by setting your editor to search for 3 white spaces together, and deleting as manyinstances you find; you will never need more than two. This will not do the complete job, but will do most. []/w3timages/icons/wink.gif[/] Mateo Byler CruceDeCaminos.com
|
|
|
|
Joined: Jul 1999
Posts: 118
Enthusiast
|
Enthusiast
Joined: Jul 1999
Posts: 118 |
an automatic solution is needed. Probably all double or triple spaces, at start of line, can be removed from the code?? or a more complicated solution, a specific perl routine that edits only inside html print statements??
|
|
|
|
Joined: Apr 2000
Posts: 29
Member
|
Member
Joined: Apr 2000
Posts: 29 |
I just want to point out the logic of this, for those who think its "petty". My employer (who announced earnings yesterday and immediately plummetted into the stock toilet) serves up, oh, several hundred million pages views a day, or some such nonsense... if you look at the front page of almost every one of our sites, you'll see much the same thing the poster is describing ... they're optimized to reduce the number of bytes to what is absolutely required.
This is good for your users... it takes less time to download. This is good for your site... less bandwidth means cheaper costs and better performance of the server itself.
It's win-win all around.
D
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|