Mindcontroll Forum Index
Mindcontroll Forum Index FAQ Memberlist Search

Mindcontroll Forum Index » Programs/Programming Development » Webpage compression
Post new topic  Reply to topic View previous topic :: View next topic 
Webpage compression
PostPosted: 09-18-2002 07:04 AM Reply with quote
TuMTuM
Will code HTML for food!
Joined: 17 Feb 2002
Posts: 425




Note to Plastic: Damn it, it took me 15 minutes cause vbb kept using html here, it looked all funky?

I have been thinking about this for some time now, and I think it is extremely usefull in a dynamic webpage. What I am talking about is html compression. How should you see this? Ok, gonna explain it now.

on a dynamic page, most of the content is the same. Look at a forum, you will always see the same tables, the same values (post count, location, signature, etc.) and they all take space while downloading a thread. Most of this space is fulled with text that you want to see, but a lot of it is just html tags, signatures, etc.
Now what if you take a thread on a forum and take it apart. Ill try to use (what I think is) xml, as that seems to be pretty compact.

ok, so you have the threads topic, with info about the topic date etc.:
Code:

<thread>
<topic>This is the topic</topic>
<topic_id>1</topic_id>
<attributes>locked</attributes>
<starter>TuMTuM</starter>
<starter_id>1</starter_id>
<views>1</views>
<rating>5</rating>
<last_date>09/18/02 13:56</last_date>
<last_nick>TuMTuM</last_nick>
<last_id>1</last_id>
</thread>


This still seems a bit big, so lets shrink it a bit.

Code:

<thread><t>This is the topic</t><tid>1</tid><s>TuMTuM</s><sid>1</sid><v>1</v><r>5</r><ld>09/18/02 13:56</ld><ln>TuMTuM</ln><lid>1</lid></thread>



Ok, now let us compare that to the way vbb parses this onto the index
Code:

<tr align="center">
   <td bgcolor="#d6dae6"><img src="http://66.78.32.3/~legal-ch/g-force/dot_folder.gif" border="0" alt=""></td>
   <td bgcolor="#BFC5D3">&nbsp;</td>
   <td bgcolor="#d6dae6" align="left" width="70%"><font face="verdana, arial, helvetica" size="2">
                          <img src="http://66.78.32.3/~legal-ch/g-force/paperclip.gif" alt="1 Attachment(s)" border="0" align="absmiddle">
                          <a href="showthread.php?s=&threadid=754">XMB Forum</a></font> <font face="verdana,arial,helvetica" size="1" ></font></td>
   <td bgcolor="#BFC5D3" width="30%" nowrap><font face="verdana, arial, helvetica" size="2" ><a href="member.php?s=&action=getinfo&userid=39">TuMTuM</a></font></td>
   <td bgcolor="#d6dae6"><font face="verdana, arial, helvetica" size="2" ><a href="javascript:who(754)">0</a></font></td>
   <td bgcolor="#BFC5D3"><font face="verdana, arial, helvetica" size="2" >13</font></td>
      <td bgcolor="#d6dae6" align="center"><img src="http://66.78.32.3/~legal-ch/g-force/clear.gif" border="0" alt="0 votes - 0.00 average"></td>
   <td bgcolor="#BFC5D3">
      <table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink"><tr align="right">
         <td nowrap><font face="verdana,arial,helvetica" size="1" >08-11-2002 <font color="#000000">03:02 PM</font><br>
         by <a href="member.php?action=getinfo&find=lastposter&threadid=754"><b>TuMTuM</b></a></font></td>
         <td nowrap>&nbsp;<a href="showthread.php?s=&goto=lastpost&threadid=754"><img src="http://66.78.32.3/~legal-ch/g-force/lastpost.gif" border="0" alt="Go to last post"></a></td>
      </tr></table>
   </td>
</tr>


Ok, what do we see? we have a lot of tags of links that point to for instance the topic id, or the starters id, etc. We have tags of background colors, tables etc.

What if we take all these tags out, and have a javascript on the client parse this? Javascript stays on the clients PC, so he only has to download it once. You can have javascript change the shorter tags into html and therefore save download time and bandwitdh.

Let us discuss this further, as I was thinking about making something like this, but I dont know javascript Very Happy.
View user's profile Find all posts by %s Send private message Send e-mail

PostPosted: 09-21-2002 08:04 AM Reply with quote
js995
Deletes your posts
Joined: 10 Feb 2002
Posts: 226




for a start, XML doesnt render from its custom tags, its a data output language. Therefore you must use a XSLT stylesheet to format the XML out, or use a XML object parser on the server-side. (works good for providing to WML or lower browser content).

If you try making pages that validate against XHTML 1.0-Strict , you will quickly find that styling is NOT meant to be within HTML. For example, I made my new personal site compatible as such, and all its styling is encapsulated in a CSS document (none in the html, and the css validated against CSS2) ..

if you are interested in pursuing this still, e-mail me.

BTW, dont try to do this for vbulletin.wouldnt want to be supporting non-free competition against open-source forums.. *cough* phpBB *cough* would you now ? Smile
View user's profile Find all posts by %s Send private message

PostPosted: 09-21-2002 11:16 AM Reply with quote
TuMTuM
Will code HTML for food!
Joined: 17 Feb 2002
Posts: 425




js995 wrote:

for a start, XML doesnt render from its custom tags, its a data output language. Therefore you must use a XSLT stylesheet to format the XML out, or use a XML object parser on the server-side. (works good for providing to WML or lower browser content).

If you try making pages that validate against XHTML 1.0-Strict , you will quickly find that styling is NOT meant to be within HTML. For example, I made my new personal site compatible as such, and all its styling is encapsulated in a CSS document (none in the html, and the css validated against CSS2) ..

if you are interested in pursuing this still, e-mail me.

BTW, dont try to do this for vbulletin.wouldnt want to be supporting non-free competition against open-source forums.. *cough* phpBB *cough* would you now ? Smile


No, I meant you use tags like xml that will give the stuff you need to render the page. The rendering of the page is done on the client side by a javascript, or something of that cause you only need to download that once.
View user's profile Find all posts by %s Send private message Send e-mail

PostPosted: 09-21-2002 11:33 AM Reply with quote
js995
Deletes your posts
Joined: 10 Feb 2002
Posts: 226




um, thats what xml was designed for, and the rendering is what XSLT and XML aware browsers do. why reinvent the wheel ?
View user's profile Find all posts by %s Send private message

Webpage compression
 Mindcontroll Forum Index » Programs/Programming Development
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You can vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic  


Video Games Suck - XXXSwim - Archive
  Powered by phpBB © 2001-2005 phpBB Group. Designed for Trushkin.net | Themes Database