|
|
Turbo-charge your CB Template!
|
|
Date: 2006/07/20 04:13
|
By: miseryhead75
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 9 |   | |
|
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!
|
|
The topic has been locked. |
|
|
|
Re:Turbo-charge your CB Template!
|
|
Date: 2006/07/20 04:25
|
By: pcjunkie
|
Status:
|
|
|
Karma: 1  
|
|
Senior Joomlapolitan  | Posts: 70 |   | |
|
Nice work!
I will give this a bash when I wake up. (been up all night hacking pixels)
<3
|
|
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 |   | |
|
|
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!
|
|
The topic has been locked. |
|
|
|
Re:Turbo-charge your CB Template!
|
|
Date: 2006/07/20 16:05
|
By: beat
|
Status: Admin
|
|
|
Karma: 242  
|
|
Admin  | Posts: 4063 |   | |
|
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
|
|
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 |   | |
|
I aplied this to my template also and it works only i IE
not in firefx
any sugestions? www.youjoomla.com
|
|
The topic has been locked. |
|
|
|
Re:Turbo-charge your CB Template!
|
|
Date: 2006/08/17 18:17
|
By: beat
|
Status: Admin
|
|
|
Karma: 242  
|
|
Admin  | Posts: 4063 |   | |
|
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
|
|
The topic has been locked. |
|
|