2

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>
Dunnbar
  • 53
  • 1
  • 8
  • Maybe some issue with your `.htaccess`? – nice_dev Aug 01 '18 at 15:39
  • To troubleshoot, open your F12 command and go to the "network" tabs on Chrome. Then, naviguate to a page that will put a long time to load, and you will have a perfect map of which file takes how many time, and even get the status code. If it is a CDN issue, you will quickly see it. – Anwar Aug 01 '18 at 15:52
  • Its possible that it's unrelated to laravel, you say an issue with a file such as js, css, or an image. I assume those are in your public folder and not served using some streaming response from within laravel itself? If it's not through a streamed response and is through a normal server request, then perhaps your server is at load and fails to deliver the content? – samuraiseoul Aug 01 '18 at 20:11
  • I use network tab a lot in Chrome, and the file which takes long time to load is never the same. Sometimes it's .png, sometimes it will be jquery.min.js. I have no CDN url for my assets. – Dunnbar Aug 01 '18 at 21:55
  • Edited my question with .htaccess code – Dunnbar Aug 01 '18 at 21:56

1 Answers1

-4

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.).

floflock
  • 586
  • 4
  • 11