Optimizing Load Times
& Performance
Alex Gvozden
www.CaseTrek.com / Eleven accelerator
alex@casetrek.com @mrsteel
Why Optimize it?
Increase UX
Rank better on Google
Use resources better
How?
Server configuration
Reduce requests and file sizes
Code optimization
Caching
Server
Choose a good hosting
Good customer service
Google for “Problem with … hosting”
Server configuration
Compress content
http://en.wikipedia.org/wiki/HTTP_compression
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html
http://www.neiland.net/blog/article/enable-gzip-compression-in-apache-
httpd-with-moddeflate/
Server configuration
Add Cache-Control and Expires headers
mod_cache & mod_expires
http://www.askapache.com/htaccess/apache-speed-cache-control.html
Or use HTTP headers, etc.
<meta http-equiv="Cache-control" content="public">
http://www.peej.co.uk/articles/http-caching.html
Server configuration
Host assets separately (JS, CSS, Images)
http://yuiblog.com/blog/2007/04/11/performance-research-part-4/
Server configuration
Host assets separately (JS, CSS, Images)
http://yuiblog.com/blog/2007/04/11/performance-research-part-4/
Reduce requests & File size
Combine and minify CSS & Javascript
https://code.google.com/p/minify/
Reduce requests & File sizes
Optimize image sizes
ImageOptim for Mac
Online http://www.smushit.com/ysmush.it/
Reduce requests & File sizes
Sprite sheets…
Code optimization
APC for PHP
Opcode cache for PHP
http://php.net/manual/en/book.apc.php
http://www.slideshare.net/vortexau/improving-php-
application-performance-with-apc-presentation
Apc.stat
Code optimization
Tips and tricks
http://www.chazzuka.com/63-best-practice-to-optimize-php-
code-performances-58/
Caching
Use APC – non distributed
or Memcached - distributed
http://memcached.org/
Cache vars, templates, SQL queries
And PHP faster-> FastCGI
Even more speed and less memory consumed
http://www.brandonturner.net/blog/2009/07/fastcgi_php_opc
ode_cache_benchmarks/

Optimize