Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Speed up osC mainpage 40%


paulm2003

Recommended Posts

My main osC page has become about 40% faster! Just by installing the Basic Template Structure (1263) and then deleting most obsolete tables.

 

It is still a table layout, but I cut down the number of tables from 49 to 20! The pages still look consistent in IE6 sp1, Mozilla1.1 and Opera 7 (did not test others yet).

 

Some numbers (index page):

 

Version:              Standard => Optimized

-------------------------------------------------

Number of Tables:    62    =>      20

Lines HTML:            497    =>    290

Avarage load time:    1.8s  =>    1.1s

Note: I only did a very quick modification, much more is possible to clean up the pages, although the speed probably wont increase much more.

 

The changes are quite easy to do (if you know some HTML and a little CSS). Although it does invlove a lot of lines (the new index page has 207 lines less now!). I left the "real scripts" alone, only editted some BTS template files and column_right.php, column_left.php and the stylesheet.css file.

 

You can take a look at http://www.televisiedokter.nl if you like, but I did not do any real styling yet, it is testing only! The interesting part is that the page is much "lighter" than the standard osC pages. Please report any HTML errors or browser problems if you find them.

 

Paul

Link to comment
Share on other sites

I use it too, it also saves a lot of work when changing bits...

 

Can I ask you something?

 

I am dutch like you are and i have a problem with my upcomming shop...

The shop only displays prices without BTW, in holland it is not allowed to show prices without BTW to end consumers.

os Commerce adds the articles without BTW in your cart and calculates the BTW when all are added up and present it in the end bill, this practice is not allowed in holland.

In holland you do the same but you still can only show Incl BTW prices with each individual product...

Is there a hack for that?

The chance is i answer here before others as i am looking for that now...

I ask because both being dutch we get the same rules under which we can put our shops up.

 

Thanks on front.

Link to comment
Share on other sites

Hi Burt,

thanks for the tip!

 

http://validator.w3.org/check?uri=http%3A%...nl%2Fcatalog%2F

 

shows 76 errors (some of which are unimportant).

validator.w3.org...www.oscommerce.com/osCommerce22ms2/

 

A standard osC install: shows 108 errors (some of which are unimportant)!

 

So the optimized version also scores much better on that point: 32 errors less than a standard osC install!

 

I also noticed standard osC produces a DOCTYPE error, it might be related. Using htmltidy I don't get these errors, only a few warnings about table summary info.

 

Paul

Link to comment
Share on other sites

I do have quite a few more lines of code than yours, but I think that quite a few people are moving in the right direction of trying to use more .css to layout the pages.

 

http://validator.w3.org/check?uri=http://w...003/default.php

 

http://validator.w3.org/check?uri=http%3A%...php%3FcPath%3D1

 

http://validator.w3.org/check?uri=http%3A%...products_id%3D1

Link to comment
Share on other sites

:o

I gave the wrong url, it should be:

http://www.televisiedokter.nl/catalog/

When mousing over the buttons two red X's showed up
Those X's are V's. They where supposed to show up, but I will remove them after all. (the navigation was intended to look like a remote, V's were a representation of the signal, but it didn't work out very well I suppose).

 

So I gave the wrong URL but thanks very much for the response!

 

Another note, thanks to Burt, the main catalog page (and most other pages) validates 100% now .

http://validator.w3.org/check?uri=http%3A%...og%2F;verbose=1

 

The validation problem has nothing to do with the BTS, CSS or the optimized pages. It is one of those "funny" little osC problems.

The URL's which show up in the document source have &'s and ='s while:

& should be @amp;

and

= should be =

in includes/functions/html_output.php (approx. line 36) and includes/functions/general.php (approx. line 160), this solved the problem for me.

 

Paul

Link to comment
Share on other sites

  • 2 weeks later...
& should be @amp;

and

= should be =

in includes/functions/html_output.php (approx. line 36) and includes/functions/general.php (approx. line 160), this solved the problem for me.

:blink:

I really would like to be able to edit my own posts sometimes, the above is totally nonsense. :o

The changes should be:

Change "&" to

CODE

& a m p;

 

"=" to

CODE

& # 6 1;

remove the spaces! I don't know how to show this code without the spaces.

 

Paul

Link to comment
Share on other sites

  • 2 weeks later...

I check Your site...and I notice this: The header is always upload...like a frame....all the rest that follow comes later...There is a way to upload the header...the first time...and change only the rest of the site as soon as you use it?

Link to comment
Share on other sites

I would like to see a big mod someday to make OSC xhtml / css compliant. And to loose a bunch of those tables and use css to position everything.. I know this is a long way off and TONS of work.. but wouldn't that be the greatest...

Image - the greatest, free..est, er?, coolest shopping cart being 100% CSS and fully xhtml compatible... OMG.. the open source community would freak!

:D

Link to comment
Share on other sites

The header is always upload...like a frame....all the rest that follow comes later.

Hi cistabue,

it might look like this because the header is just a few lines of code (in a separate div i.s.o. a table), loading very fast, the content of the pages is still table layout (allthough less tables than standard osC). Because the content layout is a table, the browser first has to load the whole table and calculate the table layout before it displays any content of the table. That is why the header comes first and it takes some time before anything else is displayed.

 

At http://www.lividpixel.net/ you can see an example of a osC test store which isn't using any tables for the main layout. It is a much better example than my page, because it is more or less the standard osC layout (my televisiedokter page is more like I quick hack, not usefull for other stores).

 

Paul

 

(Sorry for the delayed response, just came back from a holliday)

Link to comment
Share on other sites

It doesnt use any tables? How is this possible?

First the BTS ( http://www.oscommerce.com/community/contributions,1263 ) is installed on osC2.2 MS2. Then all tables in templates/main_page.tpl.php and templates/boxes.tpl.php are replaced by some div's and stylesheet settings.

 

(tables are still being used in the content area, o.a. for tabular data)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...