Speeding up WordPress on Azure Web-Apps with ClearDB — Disable Output Buffering in PHP
The behaviour of WordPress on Azure Web-Apps with disconnections in the backend, lags and delays also goes exactly in this direction.
Ok, it’s a free database — so I upgraded the database to different paid plans from ClearDB (Venus, Saturn, Jupiter) — without significant success — the website was still slow and had some delays and disconnections.
After that, I tested an Azure Linux VM as MySQL-Server for my WordPress website but I had to find, that the problems were almost the same as with ClearDB.
That was the point where I got doubt that ClearDB is the cause for this issue.
So I got the suspicion, that the PHP version or configuration of my Azure Web-App could be the sticking point — and I was right:
I found out, that PHP’s Output Buffering is the cause for the slowness of WordPress on Azure Web-Apps.
As you can read onhttp://php.net/manual/en/outcontrol.configuration.php#ini.output-buffering — since version 4.3.5, this directive is by default always ‘Off’ — but not on Azure Websites, it has the value ‘4096’.
Do change this, just create a .user.ini file in your root folder with the following text and restart your website:
output_buffering = Off;
After that you will notice a remarkable speed increase of your WordPress Website.
The combination of WordPress with ClearDB on Azure Web-Apps is certainly not the cheapest solution, but on the other hand you get a reliable, clustered database which is perfectly integrated into Microsoft’s cloud ecosystem — and it can be fast :-)