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.
Listening to BBC Radio with mpv
The BBC publishes high quality 320 kbps HLS AAC streams that can be used to listen to radio from the command-line using mpv. Here are the URLs and some aliases to start listening quickly.
Vim: So long Pathogen, hello native package loading
Vim 8 added a native way to load third-party packages. This means, for me at least, there is no longer any need to use a third party plugin helper like Pathogen.
Linux and Unix more command tutorial with examples
Tutorial on using more, a UNIX and Linux command for viewing the contents of a file or files one screen at a time. Examples of viewing a file, viewing multiple files, searching using regular expressions and opening the file in a text editor.