Blog Post

Apps on Azure Blog
3 MIN READ

How to improve performance of WP Admin - WordPress on Azure App Service

abhishekreddy's avatar
abhishekreddy
Icon for Microsoft rankMicrosoft
Feb 02, 2023

WordPress is one of the most popular content management systems (CMS) used by website developers. There are two parts to WordPress:

  1. WP Admin: Also called the backend, admin panel, or admin dashboard, this is the admin area where you can manage your website. You can edit posts and pages, install themes and plugins, add or remove users, and change website settings.
  2. Frontend: This is the section which is accessible to your users. This is where your users can read blog posts, make purchases, or participate in a forum, depending on the kind of website you build using WordPress.

A relatively common problem is that the WP Admin has low performance even when the frontend works fast for your users. Most performance enhancements that you do makes only your frontend faster. This makes it difficult to manage your website. In this article, we will learn about how we can improve the performance of WP Admin for WordPress on Azure App Service.

 

You can set up a new WordPress website on Azure App Service from the Azure Marketplace: Create WordPress on App Service - Microsoft Azure. This WordPress website on Azure App Service uses a remote storage by default where all your files are stored. Now you can configure your WordPress website to use the local storage. This improves performance significantly because the requests are now served from the local storage of the web server.

 

Here is how you can enable local storage and caching for your WordPress website on Azure App Service:

 

Step 1: Once the website is deployed, go to the resource. (if you do not understand this, refer to step 10 in How to set up a new WordPress website on Azure App Service.)

 

Step 2: Click on Configuration in the left panel.

 

 

Step 3: You will see a list of application settings with Name, value, source, deployment slot setting and options to delete and edit. Search for the application setting with Name: WORDPRESS_LOCAL_STORAGE_CACHE_ENABLED and click on the Edit button. If you cannot find the setting, click on +New application setting.

 

 

Step 4: In the Add/Edit application setting, enter the following details:
Name: WORDPRESS_LOCAL_STORAGE_CACHE_ENABLED
Value: true
Click on OK.

 

 

You should be able to see the application setting that was added and set to true.

 

 

Step 5: Click on Save. In the Save changes dialog, click Continue.

 

 

Now the web server gets restarted with local storage caching enabled.

 

Limitations:

  1. ‘Scaling out’ of App Service is not supported when this feature is enabled and might result in unexpected behavior. This application setting only works for single node applications. So, should you need more computing power to meet your requirements, you can always ‘Scale Up’.
  2. The local storage provides 10 GiB of storage. This is enough to contain WordPress core code, plugins, and themes. The static files like images or videos (stored in the folder: wp-content/uploads) are still retained on the remote file server, or you can also use BLOB storage to store them. (refer to step 7 in How to set up a new WordPress website on Azure App Service).
  3. Due to local storage being the primary storage for your website, you may observe latency with initial site startup time when App Service gets restarted.

Support and Feedback

In case you need any support, you can open a support request at New support request - Microsoft Azure.

If you have any ideas about how we can make WordPress on Azure App Service better, please post your ideas at Post idea · Community (azure.com)

or you could email us at wordpressonazure@microsoft.com to start a conversation.

Updated May 01, 2024
Version 6.0
  • rafaelfarias , you need to set WORDPRESS_LOCAL_STORAGE_CACHE_ENABLED to false should you need to scale out. 

     

    There is no downside as per the latest updates. App Service dynamic caching is available for Linux and there should be no performance impact if you set the abovementioned environment variable to false. Dynamic caching is available by default and there is no additional configuration required.

  • rafaelfarias's avatar
    rafaelfarias
    Copper Contributor

    When we configured the our website we had this feature enabled, but now we want to Scaling out our wp. I wonder if i have just to change variable to false, what else should i do? what side efect i will have my website with i turn it false

     

  • Christophe_Radja the upload folder is not included in the local cache since it is offloaded to Azure blob storage. It is not recommended to exclude other folders from the cache.

  • The "upload" folder is removed from the local cache,

    How can I remove an other folder as well ?

  • AscyabAKI's avatar
    AscyabAKI
    Copper Contributor

    Hi Abhishek

     

    Are all these options the same in a Azure Web App - Wordpress ?

    WORDPRESS_LOCAL_STORAGE_CACHE_ENABLED

    LOCAL_CACHE_OPTION

    WEBSITE_LOCAL_CACHE_OPTION

     

    We experienced loss of files when we restarted the web app. These files were images that were copied through FTPS to the webapp and what seemed to be the original location for the site and not a cache point.