Speeding up Symphony
This is an open discussion with 14 replies, filed under General.
Search
you mean beyond cachelight e cacheable DS E and a VPS with a lot of memory?
Haha yes. I’m actually just starting to play with the Cacheable DS extension to see what it’s like (as well as seeing if I can actually get CacheLite to work).
The thing is, most of my clients are smaller guys so the $50+/month for a VPS host isn’t really on their list of priorities. However, I still want to keep the site as fast as possible or the sake of the users.
I was wondering if there were any secret tricks I wasn’t privy to allowed you to keep Symphony running at peak.
- Do you have gzip enabled?
- Is all your Javascript/CSS Minified?
- Could your JS/CSS be condensed into less files?
- Does the site make use of CSS Sprites?
- If your using the Select Box Link field, have you updated to the most recent version?
There’s a set of .htaccess rules that I apply to all sites I build, I’ll post them when I at work next (3 days, long weekend :D)
I’ve never attempted to set up gzip
on a server before. I had a thought that it was only possible on VPS and not on basic shared hosting packages (which is what all my clients go for).
On Apache 2 you may try s.th. like this:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
Stupid Question: I add this is as a new line to my .htaccess file?
Yes, at the very top, normally. It might work, depending on your host’s setup…
You should check:
- Is the website still running?
- Is GZIP working?
You may use Firebug or s.th similar to check the response headers of your files. Look for a header like:
Content-Encoding gzip
Works a charm! Cut my loading time in half!
Just be aware that turning on GZip compression/DEFLATE
does not speed up Symphony - it reduces load time for users of your site. It will actually put more load onto your server, which will reduce the resources available to your Symphony site (although in a lot of cases it’s a negligible difference in CPU/memory).
In my experience it’s always worth enabling GZip compression - user experience is worth the few extra ticks on your server’s CPU.
The best thing you can do is:
- Optimise the data sources your page is loading - less data means less memory for XSLT processing;
- Optimise your XSLTs - in a lot of cases
xsl:for-each
is faster thanxsl:template
resolution. There are lots of little tricks like that that can have a dramatic impact on your page build times; - Cachelite your static pages - if the content of the pages you’re dealing with does not require dynamic display/rebuilds, and doesn’t change much consider turning on Cachelite
For good measure, here is my .htaccess
that I use for my production sites on Dreamhost: http://gist.github.com/378113. There’s a lot of good stuff there for making the browser cache resources for periods of time, which will dramatically speed up subsequent loads of your site (the user’s browser just uses locally cached copies). Combine this with Rainer’s “Datestamp Helper Extension”, and the load time for your users should decrease dramatically! The Datestamp Helper Extension is important because it tags each file with a modification time as a URL parameter, which will change when you update the file’s contents - this will mean you can cache your resources for a very long period of time.
Finally, grab a copy of the Apple WebKit nightly build for your platform and make use of the “Develop >> Show Web Inspector >> Audits” panel - it will make some pretty aggressive suggestions, but it’s good for highlighting any glaring slowdowns in your site. Don’t try to do everything it says unless you know your site will be under very, very high load.
How about a minify extension?
i was thinking about this recently as well after i read about the open source project facebook recently put out. I haven’t looked into what they are using, but sounds like it could be a possible way to improve performance.
I wouldn’t mind a technique that would minify the resulting XHTML but not the XSLT files itself. I edit those directly rather than using the Symphony interface.
That does beg the question, is there a way for XSLT to automatically minify all the resulting code so it’s all on one line and no tabs similar to what you would find on the Google home page?
It may look ugly when you view source but it works just fine in Firebug.
Doug, just turn indenting off - you need to do the following two things:
1 - Add this line to any of your XSLTs that output HTML tags with spacing:
<xsl:strip-space elements="*"/>
2 - Make sure your indent
attribute on the xsl:output
element is set to “no”:
<xsl:output method="html" media-type="text/html" encoding="UTF-8" doctype-system="about:legacy-compat" indent="no"/>
Check out my two sites to see the output:
Fantastic! I keep a raw Symphony install ready to go for projects (so I always have the lastest extensions and code) and I’ve just added this to my Master file. Thanks!
Create an account or sign in to comment.
Symphony tends to run pretty well as default but is there any extra steps that can be taken while setting up a Symphony site to really make it fly?
I was hoping people could share their tips and tricks on how they keep their sites running at top speed. I’m not really asking for the “minify your JS and CSS” sort of tips, but the ones about extensions can really speed up the front-end of the site, datasource tricks that can keep things running quickly.