Jump to content

BO really slow because of dir check


Lorem Ipsum

Recommended Posts

Hi,

 

It's not a request for help, but a response if some have the same issue I do.

I run on Prestashop 1.7.2.4 so this "bug" may have been in the newer version, don't have time to check.

Here is the inital problem :

A week after going LIVE with a customer website, we started to have REALLY slow admin page. I'm talking between 7 up to 20 sec to load.

I spent 2 hours looking for the root of the problem and found it!

The admin always test the directories (cache, img, modules, etc.). and for some directories it does that recursively. Needles to say, it's slow when you start to have some cache piling up.

So here is my fix : override the ConfigurationTest class :

<?php

class ConfigurationTest extends ConfigurationTestCore{
	//saves 0.5/1 sec
    public static function test_img_dir($dir)
    {
        return ConfigurationTest::test_dir($dir, false);
    }
	//save 0.3/1sec
    public static function test_module_dir($dir)
    {
        return ConfigurationTest::test_dir($dir, false);
    }
	//save A LOT of time!
    public static function test_cache_dir($dir)
    {
        return ConfigurationTest::test_dir($dir, false);
    }
}

The false parameter is useless, it's false by default, just to show you what's changed (used to be true).

 

I hope it helps someone else and I hope there is/will be a fix for this in the future.

 

Regards.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...