Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


Turbo-charge your CB Template!
Date: 2006/07/20 04:13 By: miseryhead75 Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 9
graphgraph
I found out how to speed up my Joomla site through compression, but with CB, the user profiles were taking a while to load. Here's a tip for speeding them up!

Find your default template.css file, and add this code to the very top of it:
Code:

 <?php  ob_start ("ob_gzhandler"«»); header("Content-type: text/css; charset: UTF-8"«»); header("Cache-Control: must-revalidate"«»); $offset 60 60 ; $ExpStr "Expires: " gmdate("D, d M Y H:i:«»s", time() + $offset) . " GMT"; header($ExpStr); ?>



Rename the file to template.php, and upload it to your server, in the same directory as the original template.css. Be sure to backup your original template.css file, incase you have problems!

Then, in the administrator/components/com_profiler/comprofiler.class.php file, find this line, around 1457 for me:
Code:

 <link type="text/css" rel="stylesheet" href="' . selectTemplate($ui) . 'template.css" />

. Replace it with
Code:

 <link type="text/css" rel="stylesheet" href="' . selectTemplate($ui) . 'template.php" />



Check the profiles on your frontend now, and see how quickly the profiles load!
Click here to see the profile of this user The topic has been locked.

Re:Turbo-charge your CB Template!
Date: 2006/07/20 04:25 By: pcjunkie Status: CB Doc subscriber  
Karma: 1  
Senior Joomlapolitan

Posts: 70
graphgraph
Nice work!



I will give this a bash when I wake up. (been up all night hacking pixels)

<3
Click here to see the profile of this user The topic has been locked.

Re:Turbo-charge your CB Template!
Date: 2006/07/20 07:43 By: miseryhead75 Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 9
graphgraph
Thanks for the compliment! I hope this works out for you as well as it has for me! I'm all about the need for speed...well, when it comes to websites, anyway!
Click here to see the profile of this user The topic has been locked.

Re:Turbo-charge your CB Template!
Date: 2006/07/20 16:05 By: beat Status: Admin  
Karma: 243  
Admin

Posts: 4066
graphgraph
Thanks for sharing this booster.

Actually, if I understand correctly, your change has effect to enable the browser (and proxies) caching for 1 hour, which is disabled by Joomla (Joomla writes also corresponding headers for that).

There are numerous W3C documents on this subject, and yes, browser caching speeds a lot browsing, including when pressing the back button.

This is actually a Joomla problem, as Joomla does suppose that content can vary at each page load, and also wants to count all hits.

It would make a lot of sense, that this decision be done by webmaster and the cache time (default could be not 0 but maybe 2 minutes) become a global joomla configuration parameter.

You should actually post this into the Joomla forum, and give a link here, so we can follow it up there.
Beat - Developer on Community Builder core Team
- If you like CB and this forum, you will love Nick's CB 1.1 reference manual ! : Click here to Get it now
- Would like to help us move faster ? Get it, and/or help us spend more time coding by helping others in this forum, many thanks
Click here to see the profile of this user The topic has been locked.

Re:Turbo-charge your CB Template!
Date: 2006/08/17 14:49 By: bennieblanco Status: User  
Karma: 3  
Junior Joomlapolitan

Posts: 35
graphgraph
I aplied this to my template also and it works only i IE

not in firefx

any sugestions?
www.youjoomla.com
Click here to see the profile of this user The topic has been locked.

Re:Turbo-charge your CB Template!
Date: 2006/08/17 18:17 By: beat Status: Admin  
Karma: 243  
Admin

Posts: 4066
graphgraph
bennieblanco wrote:
I aplied this to my template also and it works only i IE

not in firefx

any sugestions?


That's normal: the fix above does issue a duplicate HTTP header for the caching, in *addition* of that of Joomla (the later states that there is no caching). So the browser has 2 headers to choose from: as usual IE chooses one and FF the other . In addition, the specs are saying there should be only one header

That's why this improvement should go into Joomla and not into CB, as I suggested above.

The correct fix is to do the change at the end of main index.php .

Warning: your site might not reflect changes immediately, as *all* pages will then be cached (that's why Joomla does not allow browser caching at the end of index.php).
Beat - Developer on Community Builder core Team
- If you like CB and this forum, you will love Nick's CB 1.1 reference manual ! : Click here to Get it now
- Would like to help us move faster ? Get it, and/or help us spend more time coding by helping others in this forum, many thanks
Click here to see the profile of this user The topic has been locked.

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login