1. emeyer
  2. Newbies area
  3. Friday, 10 April 2009
  4.  Subscribe via email
Wow, my prototype site really speeded up with 4.0! thank you!

I made a small modification to further improve speed: compressing the compnent's javascript file. For this, one can compress it in advance, but that requires custom mime types, and the propcessor load is so low, it's easier to do it on the fily. The server must have gzip compression available in the system (which can be picked up from Joomla global config, but Joomla only compresses html files).

Compression reduced the file from 32KB to 5KB. I tried packing it beforehand but it didn't make any diference, gzip is pretty fantastic these days. The code change is simple:

1: Add the following to the top of components/com_comment/joscomment/jscripts/client.js and save it as client.php in the same directory:

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


2. Find the reference to client.js in components/com_comment/joscomment/jscript.php and change it to client.php.

That's it. It threw an IE7 error in 3.26 for one of the http functions but worked fine in 4.0. I'm looking into doing the same for an external jquery library component and combining the pieces into one file.

The files are arriving with jquery in the head. I haven't looked at that yet, but already the size is 27KB less.
Responses (3)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

Dowload all Hotspots entries
Hi there, I'm looking for a way to dowload all the Hotspots entries. I've got t...
0 Replies
Posted on Sunday, 06 April 2025
  • #kml
  • #download
Set number of hotspots / user groups
Hi, I'm working with Hotspots for my new website and I love it! After trying ...
0 Replies
Posted on Monday, 31 March 2025
J5 compatibility for Hotspots
Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
1 Replies
Posted on Monday, 24 February 2025
  • #Hotspots
  • #hotspots Joomla 5
Text size in the comment input form
Hello. How can I increase the font size in the comment input field? For examp...
0 Replies
Posted on Wednesday, 26 February 2025
  • #CComment 6
Problem with enlarged image
Hello. When you click on the image in the comments, it does not appear in the ce...
1 Replies
Posted on Wednesday, 26 February 2025