laravelpage-load-time

Laravel slow on 1st time load


I have a laravel app that loads fine on localhost but when deployed on a shared 1&1 host server (for demo purposes) the first page load is very slow (up to 12s !). It's only occuring on first page load, after that it works perfectly fine as if the site was going on "sleep" mode when not used for a while. It does sound like a cache issue though I activated all laravel caches (views, config, routes..).

Someone mentioned a similar problem on a godaddy shared host, their solution was to have a cron pinging the site every minute to keep it alive, that probably works but that's not a very satisfactory solution.

The debugger/console are not showing much :

On first page load :

Queries 343ms
Route request 12.46s
The console is showing a 12.69s TTFB waiting time

After reload

Queries 39.47ms
Route request 238ms
console 334ms.

Has anyone come across a similar issue before ?


Solution

  • Issue seems to be related to the host. Same install on a different host works perfectly, no real answer here..