Mindcontroll Forum Index Mindcontroll

 

Webpage compression
Click here to go to the original topic

 
       Mindcontroll Forum Index -> Programs/Programming Development
View previous topic :: View next topic  
Author Message
TuMTuM



Joined: 17 Feb 2002
Posts: 425

Posted: 09-18-2002 07:04 AM    Post subject: Webpage compression  

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 :D.
Back to top  
js995



Joined: 10 Feb 2002
Posts: 226

Posted: 09-21-2002 08:04 AM    Post subject:  

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 ? :)
Back to top  
TuMTuM



Joined: 17 Feb 2002
Posts: 425

Posted: 09-21-2002 11:16 AM    Post subject:  

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 ? :)

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.
Back to top  
js995



Joined: 10 Feb 2002
Posts: 226

Posted: 09-21-2002 11:33 AM    Post subject:  

um, thats what xml was designed for, and the rendering is what XSLT and XML aware browsers do. why reinvent the wheel ?
Back to top  
 
       Mindcontroll Forum Index -> Programs/Programming Development
Page 1 of 1


Video Games Suck - XXXSwim