[Phpug] Caching / Optimising / Speeding Up Php Scripts / Sites?

Fergal J Byrne editor at adnet.ie
Fri Jun 29 15:42:28 IST 2007


Michele Neylon wrote:
> Kae Verens wrote:
> 
>> you can speed up delivery of sites by doing little things like having all the 
>> static images, CSS and JavaScript hosted on a separate domain name, combining 
>> images whenever possible, and caching (in database if necessary) published 
>> pages which are not likely to change for a day or so, instead of dynamically 
>> creating them on each view.
>>
> Unfortunately the site works by updating the images etc., on the fly ...
> 
Michele,

This is very, very, very likely what the problem is.  Are
you *making* images using libgd or the like?  If so, you need
to be enormously careful because libgd has its own garbage
collector and it will try eating the brain cells of anyone
nearby once it fills up your RAM.

I had an ImageMagick-based image stamper for one site,
had to call the garbage collector after every operation.

Consider queuing up some kind of offline processing
system (Ruby-based would be best IMHO) to generate any
dynamic imagery.

Consider doing as much as possible using CSS/XHTML
and some kind of Ajax library like prototype (jQuery
is my current favourite, YMMV) and transparent PNGs
instead of actually generating live images.

-- 

Regards,

Fergal Byrne - Technical Director


Adnet: Web Builders to the Design Industry

http://www.adnet.ie/  t:+353 1 855 8951 aim/skype:FergByrne

Adnet Limited. 63 Lower Gardiner Street, Dublin 1, Ireland.
Registered in Ireland No. 229337




More information about the Phpug mailing list