Why does every page in back office suddenly open very slowly?

March 3, 2022


In general, back office slowness can be caused by a variety of issues. If you are not happy with Erply back office's responsiveness, we recommend in touch with customer support. Customer support will forward the issue to technical teams if needed, and these problems can often be resolved.

However, there is one specific scenario we have seen happen a couple of times. This issue can be fixed by account users, too; therefore, we have created this article, hoping that it might lead to faster resolutions.

Symptoms

The problem described here may be affecting your account if:

  1. All back office pages are uniformly and consistently slow (as opposed to the slowness occurring only in a specific module). For example, it might appear that all page loads are delayed by 10 seconds.
  2. Often, the menu bar at the top of the page appears right away, but the rest of the page takes a while to follow.
  3. Or — the page appears, but the “spinner” on the browser tab still keeps spinning.
  4. The browser appears to be waiting for a site named “localhost” or “127.0.0.1”:

 

 

If these are not the symptoms you are experiencing, we still recommend to report the issue to Erply customer support.

Solution

  1. If you have the permissions to manage account configuration, open Settings > Configuration. On the page, find a link titled “Edit Plugins” and click it.
  2. A page with a large text box opens. This is for adding “plugins” to back office: text snippets that modify the behavior of back office. These plugins might have been provided to you by Erply, or written by your own developers.
  3. Scan the contents of the text box, and search for code that refers to “localhost” or “127.0.0.1”.
  4. If you find such code, remove the appropriate code block, or ask someone to remove it. Here is one example what it might look like:
$.ajax({
    url: 'http://localhost:9000/main.js',                     // <------- see here
    type: 'GET',
    timeout: 3000,
    dataType: 'script',
    success: () => console.log('Script was loaded...'),
    error: () => console.error('Ooops. Something went wrong'),
});

In this particular case, the whole depicted block (8 lines) must be removed.

Explanation

Such code is added by a developer writing a plugin. In computer terminology, “localhost” and “127.0.0.1” refer to one's own computer. For convenience, a developer may want to avoid repeated copy-pasting, and make Erply back office always load a file from their computer instead.

This code does not work for anyone except the developer (no-one else has the same file on their computer, and is not even supposed to have it), and will only cause a delay while the web browser is waiting for a non-existent resource to load.

As a developer, what should I do instead? 

The simplest solution is to make the code load only for a particular user:

if (userID === 42) {
    // Development code goes here
}

Plugin variables are explained in more detail here.