Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cam_bad's avatar

Trying to find a solution to lower the TTFB

Hello there,

I'm working on a project with Laravel 8.x (latest version) and VueJs 2.

After reading and trying to apply some advices from several (very good) articles (like https://blog.cloudflare.com/ttfb-time-to-first-byte-considered-meaningles/ or https://geekflare.com/laravel-optimization/) I still can't get my TTFB down to the standard. It currently remains around 2.75sec.

What I've done :

  • Rework of the requests (n+1), locally with the laravel debugbar (https://github.com/barryvdh/laravel-debugbar) I've got between 800μs and 2.73ms (22 requests on homepage).

  • Almost all the resources that are displayed on the home page are cached, yet the performance is not as expected. With or without cache the performance remains at the same point 2.75 sec with and 2.80 with.

  • Server side => I tried to set up an 'abort(404)' on the home page and the TTFB is not even 100ms so I ruled out a problem with Nginx.

I come here to try to find a solution to lower the TTFB. If you have some more advices, I'll take it !

Regards

C.

0 likes
5 replies
cam_bad's avatar

No, in local development i'm using laravel sail (docker). And in production i'm using nginx, php 8 and mysql 8

martinbean's avatar

@cam_bad TTFB is time to first byte: it’s the time from a request hitting your server, to your application returning the first byte of a response. So, if you have a high TTFB, it means your application is doing a lot of work before it starts to return a response.

Unfortunately, it’s very application-specific. We have no idea what your app is doing behind the scenes. So you’re going to need to profile your application, find out what work it does in handling a request and before returning a response.

Please or to participate in this conversation.