I’ve been spending this morning optimizing the website in terms of load times in Browsers, and one key element of that is sending the correct expires headers to allow Browsers to cache the data.

Now, as of Plesk 11.5, you can edit nginx settings via the Control Panel, but this isn’t always straight forward, so I thought I’d write a small tutorial.

In the Control Panel:

  1. Select your Domain
  2. Click Web Server Settings
  3. Scroll down to nginx settings
  4. If you have “Serve static files directly by nginx” checked (which I recommend), you’ll need to remove the file extensions you’re going to use below, such as jpg,gif,…
  5. In the text box “Additional nginx directives” copy / paste the following configuration:

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control “public”;
try_files $uri @fallback;

That’s it. Just hit OK and enjoy a website that sends the correct headers for your static images and CSS.


Read more

One of the legacy systems we still use at is Plesk. Over the last few years it has slowly gotten better (don’t worry, it still completely breaks on every version upgrade) and nowadays comes with nginx.

However, I noticed that for some obscure reason, it doesn’t enable GZip compression for the webpages it serves? This is quite odd, having myself worked a lot with nginx over the last few years, it’s a default configuration!

Don’t worry, it’s quite easy to enable it though:

Just edit the following file as root: /etc/nginx/conf.d/gzip.conf

gzip on;
gzip_proxied any;
gzip_types text/plain text/xml text/css application/x-javascript;
gzip_vary on;
gzip_disable “msie6”;

Then run nginx -t to test the configuration and if that’s all ok, restart nginx by running /etc/init.d/nginx restart.

That’s it. Your webserver will now be serving your pages with GZip compression.

Read more


as you might have seen, I upgraded my blog, new theme as usual and now running the latest version of WordPress. This had some problems though.

I used Transmit to upload the files, and I said replace files. Apparantly this program is soo stupid, that it replaces folders, not it’s contents. Oops, my entire upload library was gone. All plugins too.

I had a backup from June this year, so I had to unpack that partially. Not easy, as I use Plesk, with it’s proprietary Backup system. But they finally released a KB article, describing how to unpack their backups which can be found here.

So now I have finally recovered most of the data, and all is getting back to normal.

My recommendation: Do not use Transmit. It’s a crappy FTP client, and it doesn’t get the fact that Replace is not folder replace but file replace.

Just a side note: Gravatar is back!!!

So my question is, what FTP client do you use on Mac?

Read more