We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

At first launch, the site thinks 3-4 seconds

I have a problem with a site on phalcon on what has been done only Hello! Problem following nature: a local machine, the server hampp. At first launch, the site thinks 3-4 seconds. After that responds quickly. It all starts when not requests page for a while. It turns the page has to "poke" that she did not die.

Are you using Volt template engine? If yes, this can be the answer. The first time you access the app is when the volt file is created, but it took about 500ms to generate these files in my machine. Try it without Volt enabled and see if this time gets better.



11.9k

No I do not use Volt



11.9k

I do not know how it works but the feeling that the dll when I do not use the site is unloaded from memory. And his work has to push



98.9k

Are you using MySQL? try changing localhost by 127.0.0.1 on the connection settings



11.9k

No, that's what is in my application:

try {

//Register an autoloader
$loader = new \Phalcon\Loader();

$loader->registerDirs(array(
    '../app/controllers/',
    '../app/models/'
))->register();

//Create a DI
$di = new Phalcon\DI\FactoryDefault();

//Setting up the view component
$di->set('view', function(){
    $view = new \Phalcon\Mvc\View();
    $view->setViewsDir('../app/views/');
    return $view;
});

//Handle the request
$application = new \Phalcon\Mvc\Application();
$application->setDI($di);
echo $application->handle()->getContent();

} catch(\Phalcon\Exception $e) { echo "PhalconException: ", $e->getMessage(); }



11.9k

maybe it's because of windows 8?



98.9k

This problem is only happening with Phalcon or with any PHP application?



11.9k

only Phalcon



98.9k

Well, I have no tested Phalcon in Windows 8, I don't think there is real trouble there, maybe the antivirus is checking the dll before loading it?



11.9k

does not seem so. I certainly can not tolerate such a development at local, but I hope the server will be different



98.9k

I'll try to install windows 8 to check, currently I'm using Windows 7/XAMPP 1.81 with SQLServer as database getting responses in 2ms-4ms



11.9k

I hang without a database



11.9k

only then echo '';

Phalcon on W8 is ok!



15.1k

Had a similar problem xampp in the past. Seems like it falls asleep if not used for a while. Switched to iis and all problems went away.



11.9k

the problem is solved. Returned to normal, unfortunately not followed then