22397 Posts in 6743 Topics by 2748 members
|Go to End|
5 February 2013 at 7:30am
We have just launched www.safari.co.uk, and its working really nice - apart from the speed. We really need to improve page load times and optimise the image library.
Can anyone sign post me to ideas / guidelines. I think there is a lot of performance to be gained in the cache of cropped images that could be served as static image instead of having to pass through the GD library everytime (or is this already happening?).
Thanks in advance for any pointers!
6 February 2013 at 9:27am
Looks like a brochureware site - so http://doc.silverstripe.org/framework/en/reference/staticpublisher - could be a huge win.
If you want to do a partial cache...
Then you have the more complicated server setup... APC, memcache, varnish (http://en.wikipedia.org/wiki/Varnish_(software)).
Lastly, of course is analysing your site with something like kcachegrind and improving the code you have added
7 February 2013 at 1:08am
Images don't get passed through the GD library every time, only when they are first resized. It then checks if a resized image exists and serves it if it does.
I agree with Swaiba - partial caching & static publishing help a lot, partial caching alone recently saved us about 30% on loading times.
7 February 2013 at 1:20am
Thanks for this. Also applied these htaccess rules which have helped a lot...
ExpiresByType text/html "access plus 7 day"
ExpiresByType text/js "access plus 7 day"
ExpiresByType image/gif "access plus 7 day"
ExpiresByType image/png "access plus 7 day"
ExpiresByType image/jpg "access plus 7 day"
ExpiresByType image/jpeg "access plus 7 day"
ExpiresByType image/ico "access plus 7 day"
ExpiresByType text/css "access plus 7 day"
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0 no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images, movies or zip files
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:avi|mov|mp3|mp4|rm|flv|swf|mp?g)$ no-gzip dont-vary
# properly handle requests coming from behind proxies
Header append Vary User-Agent
Will work on the partial cache soon, just need to work out what elements can be cached like that. Also setting up a varnish server as a test.
7 February 2013 at 4:50am Last edited: 7 February 2013 4:51am
html5boilerplate.com has a nice .htaccess file too.
11 February 2013 at 11:14am
If you missed it, there is also a blog post about performance. I use that as guide for improving performance on sites:
And then i use http://tools.pingdom.com/fpt/ to see where i should improve, and ofcourse also the showqueries=1 url param onsite.
|Go to Top|