Like many web developers I use Plesk on Media Temple’s (dv) Base server. Owing to growing popularity of this blog the server is straining a little. I’ve followed the excellent articles over at David Seah’s site and also the performance optimsation tips on the Media Temple site with good results. But I was still getting memory issues. Whilst the tips are specific to a Media Temple (dv) 3 server they should be good for most linux distros. I must stress I take no responsibility for using this article. Use at your own risk. Everyone is here to learn so if you feel you can add something please do so by leaving a comment.
In Part 1 we’re going to look at ExpressionEngine and making sure your site is set up to be lean, mean and fast. Out of the box EE does a good job of managing performance. The ExpressionEngine documentation explains the caching options available to you.
One area where EE is a little weak (probably so it is easy to install and use on many different platforms) is in the information it sends to the browser. If you are on a Apache server on Linux and AllowOverride is on you’ll be able to speed up things further using an .htaccess file or better still modifying the Apache configuration.
Here’s an the default file I use for .htaccess
FileETag none # Turn off ETag # Set Language and Character Set AddDefaultCharset utf-8 AddLanguage en-gb .en # Ensure GZIP Compression is on php_value output_handler ob_gzhandler # Cache images and set default on everything else ExpiresActive on ExpiresDefault A259200 ExpiresByType image/gif A1209600 ExpiresByType image/png A1209600 ExpiresByType image/jpeg A1209600 ExpiresByType image/gif A1209600 # Set css and js so they can be gzipped <IfModule mod_mime.c> AddType application/x-httpd-php .css AddType application/x-httpd-php .js </IfModule> # Turn off errors php_value display_errors off # Config settings for ExpressionEngine AcceptPathInfo On Options +FollowSymLinks
<?php header("Content-type: text/css"); ?>
Finally I want to make absolutely sure PHP errors are not shown and I turn on a couple of settings for EE. If you get an internal server error it is likely your host does not allow you to override certain settings. Get in touch with you host and ask. These work ok on (mt)(dv)3.
In part two I’ll be looking at optimising the hardware side of things on the (dv) 3.
Have an update or suggestion for this article? You can edit it here and send me a pull request.
Linux and Unix watch command tutorial with examples
Tutorial on using watch, a UNIX and Linux command for executing a program periodically and showing a fullscreen output. Examples of watching a file download, a network interface come up, and showing the five most CPU intensive processes.
Build your own Vim statusline
Statuslines in Vim are not hard to create. Making your own means one less dependency in your life.
Custom Vim Bindings in tmux 2.4
tmux 2.4 made a significant change to key bindings. Here is how to support custom keybindings for versions before and after tmux 2.4