How can I make less http requests?

Discussion regarding Joomla! 1.5 Performance issues.
Locked
User avatar
AGSmiff
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Fri Oct 17, 2008 3:27 pm
Location: Fife, Scotland
Contact:

How can I make less http requests?

Post by AGSmiff » Mon Aug 17, 2009 4:58 pm

Hi Guys,

I have a site that I already run smart optimizer and the new S5 CSS and JS Compressor on (great plugin btw) However, using the S5 shopper frenzy template, I still manage to make 111 http requests to load the site. Takes 22-26 seconds to load the site!

Also the response time form my server is 5 seconds and the download rate is usually 11kpbs which is rubbish...will be changing hosts to remedy this but want to max out the performance of the site from my end first.

The total size of the load is 275,187kb and the site is getting a ySlow rating of 77 Grade C...But this is the bit that really puzzles me...Another competitors site gets a lower ySlow rating (74 grade c) yet their site loads in 8secs! I reckon it has to do with the fact they only make 35 http request to get the site downloaded.

How can I reduce the http requests needed to speed up my site?

Url is supercheapmedsonline.com if anyone needs a look,

Cheers,

Andy
I blog at andysmiff.[spam].com and tweet @andy_smiff

User avatar
tecwzrd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 204
Joined: Mon Jul 20, 2009 8:00 pm
Location: Virginia
Contact:

Re: How can I make less http requests?

Post by tecwzrd » Mon Aug 17, 2009 8:38 pm

Site loaded in 4 seconds for me on broadband.

All js/css GZIPPED. Most images fully optimized except this one
http://supercheapmedsonline.com/templat ... mod_br.png

Use http://www.gracepointafterfive.com/punypng to get a 47% reduction for that png.

Godaddy isn't joking when they say "shared server" O_o
Reverse IP: 3,574 other sites hosted on this server.
http://whois.domaintools.com/supercheapmedsonline.com

Not much else you can do to optimize the site IMO. If you're experiencing slow downs it's probably server related.
If you haven't figured it out yet I like to BOLD all my links.

User avatar
GODADDY
Joomla! Explorer
Joomla! Explorer
Posts: 382
Joined: Fri Sep 07, 2007 7:28 pm
Location: Arizona
Contact:

Re: How can I make less http requests?

Post by GODADDY » Sat Aug 22, 2009 12:08 am

Andy,

Checked out your site and it seems to be loading fine. I recommend taking a look at this thread for tips on optimizing site performance: http://forum.joomla.org/viewtopic.php?f=433&t=348568

Let me know if I can help in any other way.
Official GoDaddy.com Support Representative
www.godaddy.com/community/community.aspx?tab=support www.GoDaddy.com/Community - Support Info

User avatar
AGSmiff
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Fri Oct 17, 2008 3:27 pm
Location: Fife, Scotland
Contact:

Re: How can I make less http requests?

Post by AGSmiff » Sat Aug 22, 2009 11:01 am

Thanks guys, tried all the optimization techniques apart from CSS sprites and heavily modified the .htaccess file but nothing would speed up the site at all.

Sorry Go Daddy but moved the hosting for this site over to Rochen and it now loads in 4-5 seconds everytime for us now with less extensive optimisation in place and a more normal .htaccess file
I blog at andysmiff.[spam].com and tweet @andy_smiff

jeffchannell
Joomla! Ace
Joomla! Ace
Posts: 1964
Joined: Tue Jun 09, 2009 2:21 am
Location: WV
Contact:

Re: How can I make less http requests?

Post by jeffchannell » Wed Aug 26, 2009 1:33 am

Late to the party, but here's what I use on my template for reducing http requests with javascripts:

Code: Select all

<?php
	// function to clean up whitespace, etc.
	function miniscript( $str )
	{
		// we're using three regexps here
		// the first strips double slash comments, but only if the preceeding character is not :
		// the second strips block comments that do not use ie's "@cc_on" directives and newlines
		// the third just converts all multiple tabs/spaces to a single space
		$reg = array( '/[^:]([\/]{2}[^\n].*)|([\n]{1,}[\/]{2}[^\n].*)/', '/(\/\*[^@][\s\S]*?[^@]\*\/|[\r]|[\n]|[\r\n])/', '/(\t|\s)+/' );
		$rep = array( '', '', ' ' );
		$str = preg_replace( $reg, $rep, $str );
		return $str;
	}
	// start headers
	header( "Content-type: text/javascript" );
	// expires headers
	// snatched from http://shepherd-interactive.googlecode.com/svn/trunk/jquery-css-transitions/bindings.php
	$deltaSeconds = 3600 * 72;
	$expires = str_replace('+0000', 'GMT', gmdate('r', time() + $deltaSeconds));
	header('Expires: ' . $expires); //one day later
	header('Cache-Control: max-age=' . $deltaSeconds);
	header('Last-Modified: ' . str_replace('+0000', 'GMT', gmdate('r', filemtime(__FILE__))));
	// start buffer
	ob_start( "miniscript" );
	$scripts = array( file_get_contents( 'swfobject.js' ),
	                  file_get_contents( 'effects.js' )
                );
	echo implode( "\n", $scripts );
	ob_flush();
?>
Edited, of course, for brevity, and released Kopyleft if you want to use it... maybe not the best solution (and certainly not the only one I employ) but it works well enough for me. :P
http://jeffchannell.com - Joomla Extensions & Support
http://biziant.com - Open Joomla Firewall/IDS
Unsolicited private messages/emails = hire me to fix your problem.
καλλιστι

averdier
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Feb 19, 2009 9:29 pm

Re: How can I make less http requests?

Post by averdier » Tue Oct 01, 2013 7:49 pm

jeffchannell wrote:Late to the party, but here's what I use on my template for reducing http requests with javascripts:

Code: Select all

<?php
	// function to clean up whitespace, etc.
	function miniscript( $str )
	{
		// we're using three regexps here
		// the first strips double slash comments, but only if the preceeding character is not :
		// the second strips block comments that do not use ie's "@cc_on" directives and newlines
		// the third just converts all multiple tabs/spaces to a single space
		$reg = array( '/[^:]([\/]{2}[^\n].*)|([\n]{1,}[\/]{2}[^\n].*)/', '/(\/\*[^@][\s\S]*?[^@]\*\/|[\r]|[\n]|[\r\n])/', '/(\t|\s)+/' );
		$rep = array( '', '', ' ' );
		$str = preg_replace( $reg, $rep, $str );
		return $str;
	}
	// start headers
	header( "Content-type: text/javascript" );
	// expires headers
	// snatched from http://shepherd-interactive.googlecode.com/svn/trunk/jquery-css-transitions/bindings.php
	$deltaSeconds = 3600 * 72;
	$expires = str_replace('+0000', 'GMT', gmdate('r', time() + $deltaSeconds));
	header('Expires: ' . $expires); //one day later
	header('Cache-Control: max-age=' . $deltaSeconds);
	header('Last-Modified: ' . str_replace('+0000', 'GMT', gmdate('r', filemtime(__FILE__))));
	// start buffer
	ob_start( "miniscript" );
	$scripts = array( file_get_contents( 'swfobject.js' ),
	                  file_get_contents( 'effects.js' )
                );
	echo implode( "\n", $scripts );
	ob_flush();
?>
Edited, of course, for brevity, and released Kopyleft if you want to use it... maybe not the best solution (and certainly not the only one I employ) but it works well enough for me. :P
Where does this PHP go? What file? Thanks.


Locked

Return to “Performance - Joomla! 1.5”