I'm facing a problem for a week and I'm struggling to identify the source of it. To summarize the problem, my website is very long to load from time to time (10 ~ 60sec), ending sometimes in a 504 error Bad Gateway on a file (css, img, js, totally random). I don't understand why this happens, because it may be painful for my customers.
This is not on only one page, it's on every page, but at random loads so it's hard to repeat the problem and identify it. It's not a problem of SQL, cause it also happens on my landing page which has no database request.
Does anyone has any idea from where this come from ?
Thank you in advance :)
Edit : my .htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
Options All
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
What does happen if you have something like this in your routes files, e.g. web.php and you request the route via browser:
Route::get('/test',function(){
var_dump(app()->version());
die();
});
Output should be something like this string(6) "5.6.29"
and the response take normally 600ms (depends on your ServiceProviders etc.).