I've looked around but can't find a definitive answer on if things like Images affect TTFB which would be my best guess as to why my site is taking so long to load in production. After the page is completely done being received, I see it's transferred 40.7 mb resources
which is a lot but the initial page load accounts for only 20.1kb of that, followed by images/js/css.
The .har file exported from the Network inspector:
"pages": [
{
"startedDateTime": "2022-04-01T23:10:26.010Z",
"id": "page_1",
"title": "https://example.com/",
"pageTimings": {
"onContentLoad": 5878.881000004185,
"onLoad": 6390.734000000521
}
}
],
And after this follows things such as images/js/css.
Things I tried:
- Replacing the content in index.php with a simple echo statement which was
<?php echo 'foobar'; ?>
and this resolved the issue immediately as the page took less than a second to load.
- Ensured that it had the same configuration for the cache as other applications hosted on the same server and which also take much less time to load.
composer install --optimize-autoloader --no-dev
composer dump-autoload -o
php artisan route:cache
php artisan config:cache
My Question is: although resources such as images/css/js have their own TTFB could they be increasing the time to first byte for the initial page?
Edit: Another thing I wanted to point out was that this occurs on pages that are not resource intensive and also that the server it's on is Microsoft Windows Server 2016 Standard and VMware, Inc. VMware7.1