PDA

View Full Version : HTML code optimizer?


Aaron1
12-22-2002, 08:41 AM
I maybe have a nice bandwidth tip, i haven't seen here before:

Download Absolute Html Compressor (Freeware) (http://www.serpik.com/ahc/index.htm)

And run all the contents from your templates through this tool.
That might save some kb's! Because it can:

- merge lines;
- remove unnecessary whitespace characters;
- remove unnecessary quotation marks

Xenon
12-22-2002, 01:13 PM
@Aaron: nice script, but not needed, i like my templatestructures ;)

Ok, think the beta is finished soon if there don't appear any more bugs....
Other Pages, yes, will do, but it's not that easy....
I currently look closer into showthread, but it's very hard to optimize it without rewrite it completly ;)

@Lanigironu: Well, for forumdisplay a quite similar method can be used, there is already something in my mind :)
For thread viewing look above at my answer to Aaron :)

NTLDR
12-22-2002, 05:33 PM
Originally posted by Aaron1
Download Absolute Html Compressor (Freeware) (http://www.serpik.com/ahc/index.htm)

I don't like the look of that:

remove unnecessary quotation marks. For example,
<table BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center"> will be converted to
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 align=center>;
remove <!DOCTYPE ...> tags;

^^ Removing both of those is wrong, all attributes should be in " and a DOCTYPE should also be present at the top of each page.

Aaron1
12-23-2002, 12:12 PM
Originally posted by NTLDR
Removing both of those is wrong, all attributes should be in " and a DOCTYPE should also be present at the top of each page.

The "" marks are not needed for a page to function properly, and with Doctypes its the same thing. Btw you can always turn of some of the options if you're using that tool.

If you can get a page from 80kb to 70kb, its always worth an effort i guess.

NTLDR
12-23-2002, 02:08 PM
If your following proper standards, which as a webmaster you should, the DOCTYPE is required for all HTML documents and the " are required if you use XHTML and therefore should be included if you want all users to be able to view the site correctly.

Aaron1
12-23-2002, 06:05 PM
Originally posted by NTLDR
If your following proper standards, which as a webmaster you should, the DOCTYPE is required for all HTML documents and the " are required if you use XHTML and therefore should be included if you want all users to be able to view the site correctly.

Doctype is not required at all (maybe for future browsers compatibility, and that's what a Macromedia Team Member said) Try making and viewing a page without that. And as you will see its no problem it all. XHTML? Who is talking about XHTML?

As i already said: you can turn off any option if you don't like it. Did i release my tip as a full release hack or something? Man you need to loosen up.

Forget i even mentioned that program...

NTLDR
12-23-2002, 06:11 PM
Take a look at http://www.w3.org/ maybe then you will find out how to write HTML properly. A DOCTYPE is required for all HTML documents to be valid. But of course you don't know how to write HTML.

Anyway thats all I have to say on the matter, w3c proves me to be correct.

Aaron1
12-23-2002, 06:21 PM
I won't go into discussion with you anymore, first of all you don't read my messages, second: this flaming your doing is totally inappropriate. I tried to give some tips, and apperently its not appreciated. Thanks

NTLDR
12-23-2002, 06:31 PM
I was giving a tip too, don't use the program as it will ruin the HTML, you were the one who took it further.

And where have I flamed? I've stated my opinion and the facts, nothing more nothing less.

Anyway this has nothing to do with the this or Xenons hack. My appologies to Xenon for going OT.

Chris M
12-23-2002, 06:42 PM
@Aaron1 - I don't wish to spoil Xenon's thread with a long arguement - NTLDR is correct - Pages are required to have a DOCTYPE for it to be HTML compliant according to http://www.w3.org/

He is also right in saying that it should have the quotation marks to make it XHTML compliant...

@Xenon - I would be interested to see how the showthread optimisations go - I think it is one of the largest query-makers in vB;)

Satan

Aaron1
12-23-2002, 06:44 PM
Originally posted by NTLDR
I was giving a tip too, don't use the program as it will ruin the HTML, you were the one who took it further.
I disagree IMHO. But let other people decide what to do don't you think so? Your position on this issue is clear now.

And where have I flamed? I've stated my opinion and the facts, nothing more nothing less. You where acting mr. Wiseguy. You where trying to force an oppinion to all of us. And that irritates me. Thats why i reacted to this utterly stupid OT discussion.

Anyway this has nothing to do with the this or Xenons hack. My appologies to Xenon for going OT.
You where doing it anyway, so why the oppologies?

Chris M
12-23-2002, 06:48 PM
@Aaron - NTLDR has NOT flamed you...If you continue your accusations, sarcasm and detriment to him and this thread, I will report you to the Administrators and Moderating staff of this board...

Please refrain from taking this any further - If you wish to argue your point, arrange it away from this forum, and do not associate this forum with your irrational personal dispite...

Thank you...

Satan

Aaron1
12-23-2002, 06:52 PM
Sorry, you guys are correct about this, i was out of line.
It won't happen again. If you guys are right, please send a link from http://www.w3.org/ to the makers of that tool :)

Xenon
12-23-2002, 08:50 PM
I've splitten up this thread from my hack, because it has nothing to do with it ;)

@Aaron and NTDLR: Both of you reacted, a bit too rude.
Just calm down on this issue ok? :)

It's nice to have a good discussion, but it shouldn't get into personal :)

NTLDR
12-23-2002, 09:17 PM
As I said in a post above Xenon, and also via PM with Aaron1, I appologise for taking your thread off topic and for seeming rude towards others.

Sebastian
12-23-2002, 09:20 PM
not to mention it makes something as clean as this:

<form style=\"MARGIN-BOTTOM: -2px\" action=\"/forums/search.php\" method=\"post\">
<input type=\"hidden\" value=\"$session[sessionhash]\" name=\"s\">
<input type=\"hidden\" value=\"-1\" name=\"forumchoice\">
<input type=\"hidden\" value=\"subject\" name=\"searchin\">
<input type=\"hidden\" value=\"-1\" name=\"searchdate\">
<input type=\"hidden\" value=\"simplesearch\" name=\"action\">
<input type=\"hidden\" value=\"yes\" name=\"booleanand\">
</form>

to something sloppy as this:

<form style=\"MARGIN-BOTTOM: -2px\" action=\"/forums/search.php\" method=\"post\"><input type=\"hidden\" value=\"$session[sessionhash]\" name=\"s\"><input type=\"hidden\" value=\"-1\" name=\"forumchoice\"><input type=\"hidden\" value=\"subject\" name=\"searchin\"><input type=\"hidden\" value=\"-1\" name=\"searchdate\"> <input type=\"hidden\" value=\"simplesearch\" name=\"action\"></form>

O_o

Xenon
12-23-2002, 09:23 PM
@NTDLR: no problem, i've put a smilie behind my words :)
It was, because a post was reported, so i have to say something ;)
but i think splitting the thread was a good idea, wasn'T it? ;)

NTLDR
12-23-2002, 09:27 PM
Yes, spliting was a sensible idea, both threads are nice and "clean" now :)

Sebastian
12-23-2002, 09:41 PM
where did the split go? was it a hack?

Xenon
12-23-2002, 09:44 PM
it was part of my supportthread of the forumhome optimize hack :)

nuno
02-14-2003, 04:09 PM
Originally posted by Aaron1
I maybe have a nice bandwidth tip, i haven't seen here before:

Download Absolute Html Compressor (Freeware) (http://www.serpik.com/ahc/index.htm)

And run all the contents from your templates through this tool.
That might save some kb's! Because it can:

- merge lines;
- remove unnecessary whitespace characters;
- remove unnecessary quotation marks
Thank you for this useful tool. :smoke:

Dominick
02-14-2003, 04:22 PM
http://validator.w3.org/
http://jigsaw.w3.org/css-validator/
http://www.w3.org/RDF/Validator/
http://bobby.watchfire.com/bobby/html/en/index.jsp

shoudlnt these be in everyones favorites?

nuno
02-14-2003, 04:27 PM
Perhaps you should install the program first, there's a tab called options you know?
If you don't want to remove the code, then set it off.
I've managed to reduce my homepage size by nearly 10kb.
Now multiply that by thousands of members, by million views, get it?
Screw the validator, i'm paying bandwidth here, get the picture?
Again, thank you for that link Aaron. :)

Sebastian
02-14-2003, 05:16 PM
Originally posted by nuno
Perhaps you should install the program first, there's a tab called options you know?
If you don't want to remove the code, then set it off.
I've managed to reduce my homepage size by nearly 10kb.
Now multiply that by thousands of members, by million views, get it?
Screw the validator, i'm paying bandwidth here, get the picture?
Again, thank you for that link Aaron. :)

you must only have like 1GB a month to really care about 10kb LoL ;)

sure it'll make the file smaller, but it makes it look like sh!t, it cultters it all into one huge lump of code.

Dominick
02-14-2003, 05:41 PM
Originally posted by nuno
Perhaps you should install the program first, there's a tab called options you know?
If you don't want to remove the code, then set it off.
I've managed to reduce my homepage size by nearly 10kb.
Now multiply that by thousands of members, by million views, get it?
Screw the validator, i'm paying bandwidth here, get the picture?
Again, thank you for that link Aaron. :)
I guess my point was this.

I would rather a scientific method of using code optimally IE the validator. Rather than an application that does not look for optimal code strings but optimal download time

All in all, the optimal code string will reduce cpu load and download time more than a smaller .php or .html file

feldon23
03-14-2003, 07:37 PM
NTLDR said:
If your following proper standards, which as a webmaster you should, the DOCTYPE is required for all HTML documents and the " are required if you use XHTML and therefore should be included if you want all users to be able to view the site correctly.

(donning flameproof underwear)


You are a respected member here, but I must jump in (months late, granted) with my opinions...


First, w3.org are not gods. They are a committee, an organization. They are also out-of-control and need to be reigned in. They are trying to turn HTML into a page description format, but not the correct way. The monstrosity they have created is the wrong thing to introduce now, since Acrobat PDF is now ubiquitous.

They're giving HTML so many disparate layers that it is difficult or impossible to debug. Why is the W3 not holding protests in front of Microsoft HQ for IE not supporting PNG correctly? PNG is much more exciting to me than ripping apart the current tolerable TABLE system we have now.

I firmly believe that if you follow w3.org 100% you will end up in a straightjacket.

Any time you start using CSS, you cannot use it partially--you have to use it 100%. It does not co-exist peacefully with HTML because of the nightmarish inheritance.

It took me 3 HOURS to get a simple page (http://www.feldoncentral.com/Sachs/modchat/SachsLogFeb15.html) looking the way I wanted with CSS. I should have just done a nasty search-and-replace and put manual font tags on everything. The tutorials on the web are horrible. They tell you what the tags do, not the when/where/why/how.

Look at the PHP manual. That is a COOOOOL manual. Everything has little notes about why you should or shouldn't use 1 command over another. Every command has links to examples of what situations this command is used for. There is no way I could have figured out arrays without a simple page like they wrote.

You know why I put the W3C-certified logo/button on that page (http://www.feldoncentral.com/Sachs/modchat/SachsLogFeb15.html)? Because I felt I had accomplished something by wrestling CSS under control long enough to put out a page. If I did not have a use for this code for many other websites, I'd be furious.

Maybe I am just stupid, but I think I tried 50 different ways of assigning styles to the text on that page and they all had various inheritance problems until I explicitly laid out everything. First, I tried <h1> thru <h9> tags and it made pathetic attempts to marry the standard HTML <h1> - <h6> specifications with the CSS I was giving it.


If I add this as a style at the top of my page:

#feldon26 { font-family: Arial, Helvetica; }

it makes all kinds of assumptions about what kind of linespacing, letterspacing, margins, etc. about any text you put inside:

<div id="chattext"></div>
I guess Microsoft is their role model?

HTML and CSS are supposed to be 100% explicit, 0% implicit. It should assume very little, and CSS assumes a whole hell of a lot.


Can I ask who is writing XHTML? I write fairly complex pages and I've never even heard of it. That's the great thing about standards. There are so many to choose from.

feldon23
03-14-2003, 07:57 PM
The W3.org Validator Hall of Shame

<center></center> is depreciated? So they are officially throwing out HTML?

<td background=""> is not valid HTML because background does not exist as a td tag? I wonder how they plan to do row backgrounds IN HTML without CSS then. Maybe they are just mad because Microsoft thought of this tag first?

<img src="spacer.gif"> is not valid HTML because it does not have an ALT="" tag? My website is about fish and a screen saver. It does not need to be accessible (http://www.section508.gov/) (I use ALT religiously on my other pages however).

<body LEFTMARGIN="0" BGCOLO...> And they intend for me to override the artificial 10 px margins on all sides of the page how? I am working around what I consider a bug in HTML and they tell me I'm writing invalid code? Um, ok.

<a href="version11.html"><font face="Helvetica,Arial">Download SereneScreen Aquarium version 1.1 with the new Lionfish!</a></font> They're still worried about non-perfect nesting? This is why you see hundreds of font tags on pages that could get by with 10. If a browser cannot handle "different" nesting, then the browser is buggy, not the HTML.

And there is no way to turn off these nuisance alarms in http://validator.w3.org/. I have seen, no lie, 1,000 errors on a page that displays perfectly well on IE, Opera, and Netscape before. Why can't it just tell me if I have any "show-stopping" HTML like missing end tags?


I guess vBulletin is full of HTML problems too since every single URL has this error flagged:

<a href="../forums/showthread.php?s=&threadid=1287">

cannot generate system identifier for general entity "threadid"



My HTML validator is Netscape 4.07. It absolutely breaks if you have 1 letter out of place. I know a few tags that hard-lock the program. :rolleyes: