SPEED UP YOUR SITE!

Permalink
After going insane because I can't find a host that offers APC and don't have a dedicated server to put one on my self, I did a random search on the internet for ways to speed up my php. Here is what I found:http://aciddrop.com/php-speedy/... I downloaded it, followed the install instructions, added the required code to my header.php and footer.php of my theme and wow did my site speed up. Everyone needs to check this out as an alternative to APC, eAccelerator and the others. It may not be as fast as APC but it most certainly sped up my site.http://www.paullemke.net

pakigreenl
View Replies:
myFullFlavour replied on at Permalink Reply
myFullFlavour
I would be interested to hear the official Concrete5 core teams thoughts on this - I haven't heard of speedy before.

As a heads up, I'm not sure if the two suggested 'budget' hosts by Concrete5 offer APC and a 'concrete5 optimized' hosting environment, but

1) If you have some dollars, and your project is of a commercial nature, I'd recommend the $45 a month Concrete5 hosting plan - offered by Concrete5.org under the services page.

2) If paying over $500 a year is too much, Full Flavour Media offer a Concrete5 optimized plan for $100/yr - email [email protected] for more details.

NB: Price is only valid for members ofhttp://www.concrete5.org as our normal rates are three times the 'Concrete5 special price'.
katalysis replied on at Permalink Reply
katalysis
I started experimenting with Minify a few months back http://code.google.com/p/minify/... it seems to be a similar thing.

I found some real gains in speed although I think to make it really sing it will need some more complicated configuration to pick up all the odd css and js files in various C5 blocks and packages.

In the end we found the speed we needed by sorting our servers with apc cache and http compression etc. but this approach would add even more performance. Would be great to see it built into the core.
Mnkras replied on at Permalink Reply
Mnkras
I actually have it partially working, the initial generation of the minfied files is painfully slow, and iv only gottten it to work on the front end.
plschneide replied on at Permalink Reply
plschneide
Hey PakiGreen,

I tried to install this to help a very ailing site, but I get the Fatal error: Call to a member function finish() on a non-object when I put it in.

I installed - it seemed to be fine - then I added the header require link to the top of my header.php file (also tried later adding it to the top of the index.php) and then put the footer link at the very bottom of the page.

but am getting that error. Did you do anything different? Any ideas?
pakigreenl replied on at Permalink Reply
pakigreenl
Can you add a link to the site so I can see where it is being placed? You installed with no problem? Went with all the default settings?
plschneide replied on at Permalink Reply
plschneide
http://aircarecolorado.com

Though I removed the footer link that was erroring out as this is a live site.
plschneide replied on at Permalink Reply
plschneide
http://aircarecolorado.com

Though I removed the footer link that was erroring out as this is a live site.
pakigreenl replied on at Permalink Reply
pakigreenl
When you put it in, did you go to your template in the elements folder where the header.php and footer.php file are. Open those an in the header file the code should be at the top above everything like this:
<?php
require('//php_speedy_wp/libs/php_speedy/php_speedy.php');
?>
<?php  defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<!-- Site Header Content //
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('menu.css')?>" />-->
<style type="text/css">
   /* CSS Document */

The footer code goes in the footer.php file below everything else like this:
<div id="backlink"><a href="http://apycom.com/"></a></div>   
               </div>   
</body>
</html>
<?php
$compressor->finish();
?>

If that is not where you put it try doing this and see if that corrects the problem.
plschneide replied on at Permalink Reply
plschneide
Just changed it back - that is what I had and am getting the same error

<?php require('/var/www/html/php_speedy_wp/libs/php_speedy/php_speedy.php'); ?>
<?php  defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Language" content="US En">
<meta name="Copyright" content="Air Care Colorado">
<meta name="Coverage" content="Worldwide">
<meta name="Robots" content="index, follow">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="<?=$this->getStyleSheet('styles.css'); ?>" type="text/css" />
<?php Loader::element('header_required'); ?>   
</head>



and the footer element

<div id="footer"><a href="/index.php/about-envirotest/">About Envirotest</a> | <a href="/index.php/sitemap">Sitemap</a> | &copy;<?php print (date('Y')); ?> Envirotest
  <div id="partners"><a href="/index.php/repair-bay/maintenance-matters/"><img border="0" src="<?=$this->getThemePath();?>/images/maintenancematters_small.png" width="97" height="63" alt="Maintenance Matters" border="0" /></a> <a href="/index.php/rapidscreen/truck-locations/"><img src="<?=$this->getThemePath();?>/images/rapidscreen.jpg" width="137" height="61" alt="RapidScreen Van Locations" border="0" /></a> <a href="http://www.bbb.org/denver/business-reviews/auto-inspection-stations/envirotest-systems-in-arvada-co-43711" target="_blank"><img src="<?=$this->getThemePath();?>/images/bbb.jpg" width="37" height="60" alt="Better Business Bureau" border="0"/></a></div></div>
</div>
<?php  defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<?php  Loader::element('footer_required'); ?>
</body>
</html>
<?php
 $compressor->finish();
?>
pakigreenl replied on at Permalink Reply
pakigreenl
Well, I guess just double check to make sure the file path in the header script is correct. After that, the best I could suggest is to uninstall and start over with a fresh install.
plschneide replied on at Permalink Reply
plschneide
Hmm I actually installed it on another server that had the same site installed on it.

Same problem.

I FTPed into the account and (the other server)

http://aircarecolorado.studio5d.com/...

and saw the cache files here
/var/www/html/aircarecolorado/temp/php_speedy_wp/libs/php_speedy


Under path info in the config I made a change so it matched this path - (it was using an alternate path - but essential the same)

No change

I suppose I could try it on even another concrete site - but not sure what would be different. You used the install program that came with it right - not a manual install is that correct?
pakigreenl replied on at Permalink Reply
pakigreenl
I don't know if you need the /var/www/html part of the file path. When available on sites I've worked on the HTML folder is where your index file is, so it's essentially the root folder. It looks like that is where the php speedy folder was placed as well. So being that the header code shows when the index file loads, the path would be as if you were calling from the index page. So try removing that part.
plschneide replied on at Permalink Reply
plschneide
Okay this is very weird. I tried that. It gave an actual error and then I tried going back to the path and now it is NOT giving an error.

What is the best way to determine if it is actually working? At the moment it seems faster - but then I've seen it seem faster and then slow to a grinding halt as well.
pakigreenl replied on at Permalink Reply 1 Attachment
pakigreenl
click on about three pages. It needs to cache the page once. After that when you go back to the page it should pull up quickly. click back and forth between them a couple of times. The transition time should speed up. You might want to check your C5 sites cache settings as well and set them to compliment what the phpspeedy script is doing. I've attached an image of C5's cache settings(found in site wide settings).(1440 minutes is 24 hrs)

As large as your site is this should help. If you have pages on the site that are updated regularly you can specify them not to cache and that must be done on the page level. In order for that to work you must have the "Enabled if blocks allow it, unless specified at page level." option selected in C5's cache settings. That way if there are pages not touched often the should all remain cached for what ever time you have set them for.(In my case one day)
pakigreenl replied on at Permalink Reply
pakigreenl
Just went and checked your site. With the exception of the first pages load time the rest of the site transitions page-to-page pretty quickly. What do you think?
plschneide replied on at Permalink Reply
plschneide
Well the page has crawled to a halt - had to reboot the server and now is working but going VERY slow. So this may have helped but there is probably some other big problem. Sigh days like this make me want to throw Concrete out the window! Thanks though so much for your help in getting this going - I am sure it will help once the other (whatever it is) issue(s) are resolved.

Are there any benchmarks you used to compare the old version to new version - I am probably going to try this on another concrete site and see if it gets better and want to do a more than "it seems faster" check.

Paul


-----Original Message-----
From: Concrete5 Community [mailto:[email protected]]
Sent: Wednesday, May 25, 2011 10:03 AM
To: [email protected]
Subject: SPEED UP YOUR SITE!: SPEED UP YOUR SITE!
plschneide replied on at Permalink Reply
plschneide
Moved to another server - that seemed to make the most difference. I then tried to install this again - everything went fine, but I still get the

Fatal error: Call to a

error. I've posted to the speedy site to see if they have any suggestions.

Paul
carlos123 replied on at Permalink Reply
This PHP script "Speeds up the display of your blog by combining your JS and CSS files, adding far future expires headers and GZIPing." (from the php code itself).

A couple of thoughts about this.

All this can be added on your own using Apache directives in the .htaccess file and otherwise. So there really is no need for speedy PHP. A given I suppose but doing it on your own allows for finer control of what happens.

More importantly if you use this script and it sets far future expires what happens if a file with a far future expires header changes? Such that you would want it to be reloaded and recached?

Take for example a change in some CSS file that controls the rendering of what your site looks like in some way.

I don't think speedy PHP takes the need for such refreshed objects into account.

If that is the case then it falls on web site owners to undo speedy PHP set far future headers temporarily to allow objects to be reloaded and recached when they might need to be.

Not sure if site owners are up to that overall.

Just something to keep in mind as it may involve making changes to the .htaccess file and otherwise. Beyond the scope of what most site owners are capable of doing.

Of course they can always pay us developers to reset the far future headers as needed :). But that does defeat the purpose of using Concrete5 as a CMS that is relatively easy for site owners to use I think.

Carlos