TTFB for site in Plesk is too high. What can be done to improve it?




  • Avatar

    Plesk for Linux, on additional directives for HTTPS return error:

    Invalid nginx configuration: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /var/www/vhosts/system/<domain>/conf/vhost_nginx.conf:3 nginx: configuration file /etc/nginx/nginx.conf test failed

    Comment actions Permalink
  • Avatar
    Maxim Krasikov

    Hello @Lucaele,

    The directives provided in the article are correct.

    The error you faced caused by the bad syntax of the additional Apache or nginx directives.
    Please go to Plesk > Domains > > Apache & nginx Settings and review directives in the following fields:

    • Additional directives for HTTP
    • Additional directives for HTTPS
    • Additional nginx directives

    Usually, the cause is connected with the missing ";" or "}" character at the end of the mentioned in the error message row (line 3 in your case).

    Comment actions Permalink
  • Avatar

    Hi @Maxim,

    my mistake, now directives is ok but on first page load there is same slow TTFB.
    After first page load, TTFB is very fast.

    So, why and is there any way to reduce first load page TTFB?

    [First test]
    Lookup time: 0,004646
    Connect time: 0,016574
    SSL handshake time: 0,050082
    Pre-Transfer time: 0,050380
    Redirect time: 0,000000
    Time to first byte: 1,491669

    Total time: 1,491685


    [Second test (after 10 seconds since first test)]
    Lookup time: 0,005298
    Connect time: 0,015906
    SSL handshake time: 0,052253
    Pre-Transfer time: 0,052553
    Redirect time: 0,000000
    Time to first byte: 0,066420

    Total time: 0,066436


    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    @Lucaele, I would no trust the second request because it could have been cached. Given the complexity of addressing TTFB I recommend reviewing the website code and structure with a developer in order to optimize for better performance.

    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request