Very BAD TTFB

#1
Hi! I am trying to get at least a decent TTFB with Litespeed but I keep failing. I have installed LScache plugin, it works as intended (lscache: hit), images are compressed, everything seems allright except TTFB is always abysmal. I checked the wiki, removed as many plugins as I could without losing functionalities, still no improvement.

Any help would be appreciated at this point: librairiezbookstore.com
 

NiteWave

Administrator
#4
yes, it is.
however, what I see it's "x-litespeed-cache-control: no-cache" instead of "x-litespeed-cache: hit"
see below:
Code:
[root@globalsupport ~]# curl -IL librairiezbookstore.com
HTTP/1.1 301 Moved Permanently
Connection: Keep-Alive
Date: Fri, 03 Apr 2020 03:21:37 GMT
Server: LiteSpeed
Location: https://librairiezbookstore.com/
Cache-Control: no-transform,no-cache
Referrer-Policy: no-referrer
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
Expect-CT: enforce, max-age=21600
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Powered-By: thirty bees
X-Accelerated-By: Inveo PrestaShop Accelerator 1.5
Set-Cookie: thirtybees-cf81073aace23e555a65b695742a6978=b3lDU2ZoUXlFcms9bC9ucXc0UzVZckk9VmhxUjRVNEE0VEE9ZWNDa3owS29idFU9KzdLbFFrYWNTNDA9NmxndHZKNFVaQkU9eVRScStFbkZOWHM9NkYvU2xRak9QRFU9am03K2NDdTRLNms9azFmUDlQRHVybzQ9ckZvbVFBaXVkOWM9ZWc0QTdwaWk3V0E9eDhLVnk4WWhub0U9cE9mNmxZWXRYQzg9SlQwKzRka2Rpd2s9WjU4dzZzQlBkR3M9WStYZ1FUTnhHV289WmN3dWw0cjdPOFE9TGhWa0wyaW13YmM9Y3JaYS9BR2lRNDg9MU9nUHhyZDliVWc9NUJjSEd1Q2N6T2M9V3IzUDFESFZkdGs9MDAwMTc0; expires=Thu, 23-Apr-2020 03:21:38 GMT; Max-Age=1727967; path=/; domain=librairiezbookstore.com; secure; HttpOnly
Set-Cookie: lsc_private=b12ffac7dd66785f62297a4fff6d7346; path=/; domain=librairiezbookstore.com; secure; HttpOnly
Set-Cookie: _lscache_vary=ctry%7EUS%7Ecurr%7E2%7E; path=/; domain=librairiezbookstore.com; secure; HttpOnly
X-Litespeed-Cache-Control: no-cache
Cache-Control: public, max-age=0,no-transform,no-cache
Expires: Fri, 03 Apr 2020 03:22:11 GMT
Date: Fri, 03 Apr 2020 03:22:11 GMT
Server: LiteSpeed
Referrer-Policy: no-referrer
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
Expect-CT: enforce, max-age=21600
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
Vary: User-Agent
Alt-Svc: quic=":443"; ma=2592000; v="43,46", h3-Q043=":443"; ma=2592000, h3-Q046=":443"; ma=2592000, h3-Q050=":443"; ma=2592000, h3-25=":443"; ma=2592000, h3-27=":443"; ma=2592000
 
#5
OK. So you are checking the headers directly. Why is Chrome telling me it is a hit if it is not? Where could I activate the X-Litespeed-Cache-Control?
 

NiteWave

Administrator
#6
did tests again, now in a Chrome incognito window.
first visit to /en/, it's "x-litespeed-cache-control: no-cache", and super slow
2nd visit(refresh), it's "x-litespeed-cache: hit" and very fast.

so the actual issue is : why a fresh 1st visit always get "x-litespeed-cache-control: no-cache" ?
Code:
Set-Cookie: lsc_private=b12ffac7dd66785f62297a4fff6d7346; path=/; domain=librairiezbookstore.com; secure; HttpOnly
Set-Cookie: _lscache_vary=ctry%7EUS%7Ecurr%7E2%7E; path=/; domain=librairiezbookstore.com; secure; HttpOnly
do you know from where above 2 cookies are set ?
if you disable above 2 cookies, will the actual issue be gone ? you can try it just for quick tests.
 
#7
Both of these cookies appear to be generated by the litespeed Prestashop cache module. If I disable the module, the cookies are gone but the site is even slower...
 

NiteWave

Administrator
#8
can you disable service worker to see if any difference ? you may need create a ticket with us for this issue if still so slow.
 

serpent_driver

Well-Known Member
#9
The reason why there is a no-cache header ist caused by POST request. Request frontpage and make a browser reload. Check also requests in developer console. The main document is no GET request, it is POST and POST requests will not be cached.

By the way, this page is terrible. 3MB and 30 requests only for Javascript is horrible. To run LScache makes no sense. Clean this page and you will get more and besser results.

How fast a PrestaShop can be with LScache check: https://www.presta.litecache.de/ It has more than 100.000 items running on a vServer without any additional optimizations and disabled PrestaShop built-in cache.
 
Last edited:
#11
How fast a PrestaShop can be with LScache check: https://www.presta.litecache.de/ It has more than 100.000 items running on a vServer without any additional optimizations and disabled PrestaShop built-in cache.
The example you gave me took over 10 seconds to load the front page. Not what I call fast. I agree there are issues with my site. But we score high on most issues, just not TTFB. Is there room for improvement, most certainly. But a ten seconds loading time is nothing to brag about! :)

Thanks for the clarification on the GET and POST requests.
 

serpent_driver

Well-Known Member
#12
The example you gave me took over 10 seconds to load the front page. Not what I call fast. I agree there are issues with my site. But we score high on most issues, just not TTFB. Is there room for improvement, most certainly. But a ten seconds loading time is nothing to brag about!
Maybe it is caused by your are sitting in Timbuktu? ;) This can be the only reason why your request time is so slow. https://www.presta.litecache.de uses fastest Internet Backbone in the world (Frankfurt/Germany).
 

serpent_driver

Well-Known Member
#16
TTFB of your page isn't bad, but could be better if you use better network connection at your hosting provider. Too many hops and too much packet loss force too much time for packet transfer. Search for WIN application "WinMTR" and you can ceck it by yourself. The less of the number of hops and the lower the rate for data loss the shorter TTFB is.

Code:
|------------------------------------------------------------------------------------------|
|                                      WinMTR statistics                                   |
|                       Host              -   %  | Sent | Recv | Best | Avrg | Wrst | Last |
|------------------------------------------------|------|------|------|------|------|------|
|                               localhost -    0 |  380 |  380 |    0 |   14 |  109 |    0 |
| ipbcc0ccfe.dynamic.kabel-deutschland.de -    0 |  380 |  380 |    0 |   12 |   94 |   16 |
|     83-169-136-214.static.superkabel.de -    0 |  380 |  380 |    0 |    9 |   32 |    0 |
|      83-169-156-98.static.superkabel.de -    0 |  380 |  380 |    0 |   10 |   32 |    0 |
|                           145.254.3.102 -    0 |  380 |  380 |    0 |   12 |   31 |   16 |
|                           145.254.2.201 -    0 |  379 |  379 |    0 |   13 |   78 |   16 |
|                ae17-100-xcr1.muc.cw.net -    0 |  379 |  379 |   15 |   22 |   32 |   15 |
|                    ae21-ucr1.vie.cw.net -    0 |  379 |  379 |   15 |   30 |   78 |   32 |
|   be1273.ccr51.vie01.atlas.cogentco.com -    0 |  379 |  379 |   15 |   26 |   47 |   15 |
|   be3420.ccr51.beg03.atlas.cogentco.com -    0 |  379 |  379 |   31 |   48 |   94 |   47 |
|   be3421.ccr31.sof02.atlas.cogentco.com -    0 |  379 |  379 |   31 |   47 |   94 |   47 |
|   be3331.ccr31.buh01.atlas.cogentco.com -    0 |  379 |  379 |   46 |   76 |  343 |   94 |
|   be3666.rcr21.ist01.atlas.cogentco.com -    0 |  379 |  379 |   46 |   76 |  125 |   93 |
|                             149.14.44.2 -    0 |  379 |  379 |   46 |   75 |  140 |   94 |
| 212.156.143.6.static.turktelekom.com.tr -    0 |  379 |  379 |   62 |   79 |  110 |   94 |
|                   No response from host -  100 |  379 |    0 |    0 |    0 |    0 |    0 |
|                   No response from host -  100 |  379 |    0 |    0 |    0 |    0 |    0 |
|                      tardu.veridyen.com -    0 |  379 |  379 |   62 |   81 |  140 |   93 |
|________________________________________________|______|______|______|______|______|______|
You can improve page load if you follow Pagespeed instructions like preloading objects. Ads on your page causes more page load time.
 
#17
TTFB of your page isn't bad, but could be better if you use better network connection at your hosting provider. Too many hops and too much packet loss force too much time for packet transfer. Search for WIN application "WinMTR" and you can ceck it by yourself. The less of the number of hops and the lower the rate for data loss the shorter TTFB is.

Code:
|------------------------------------------------------------------------------------------|
|                                      WinMTR statistics                                   |
|                       Host              -   %  | Sent | Recv | Best | Avrg | Wrst | Last |
|------------------------------------------------|------|------|------|------|------|------|
|                               localhost -    0 |  380 |  380 |    0 |   14 |  109 |    0 |
| ipbcc0ccfe.dynamic.kabel-deutschland.de -    0 |  380 |  380 |    0 |   12 |   94 |   16 |
|     83-169-136-214.static.superkabel.de -    0 |  380 |  380 |    0 |    9 |   32 |    0 |
|      83-169-156-98.static.superkabel.de -    0 |  380 |  380 |    0 |   10 |   32 |    0 |
|                           145.254.3.102 -    0 |  380 |  380 |    0 |   12 |   31 |   16 |
|                           145.254.2.201 -    0 |  379 |  379 |    0 |   13 |   78 |   16 |
|                ae17-100-xcr1.muc.cw.net -    0 |  379 |  379 |   15 |   22 |   32 |   15 |
|                    ae21-ucr1.vie.cw.net -    0 |  379 |  379 |   15 |   30 |   78 |   32 |
|   be1273.ccr51.vie01.atlas.cogentco.com -    0 |  379 |  379 |   15 |   26 |   47 |   15 |
|   be3420.ccr51.beg03.atlas.cogentco.com -    0 |  379 |  379 |   31 |   48 |   94 |   47 |
|   be3421.ccr31.sof02.atlas.cogentco.com -    0 |  379 |  379 |   31 |   47 |   94 |   47 |
|   be3331.ccr31.buh01.atlas.cogentco.com -    0 |  379 |  379 |   46 |   76 |  343 |   94 |
|   be3666.rcr21.ist01.atlas.cogentco.com -    0 |  379 |  379 |   46 |   76 |  125 |   93 |
|                             149.14.44.2 -    0 |  379 |  379 |   46 |   75 |  140 |   94 |
| 212.156.143.6.static.turktelekom.com.tr -    0 |  379 |  379 |   62 |   79 |  110 |   94 |
|                   No response from host -  100 |  379 |    0 |    0 |    0 |    0 |    0 |
|                   No response from host -  100 |  379 |    0 |    0 |    0 |    0 |    0 |
|                      tardu.veridyen.com -    0 |  379 |  379 |   62 |   81 |  140 |   93 |
|________________________________________________|______|______|______|______|______|______|
You can improve page load if you follow Pagespeed instructions like preloading objects. Ads on your page causes more page load time.
Thanks for the winmtr. i will check again. but I did not understand what you said other. "Preloading objects?" ads? ads slow down the site. Does litespeed offer solutions for ads? for example, lazyload ads. would be great
(Sorry, i am using translate)
 

serpent_driver

Well-Known Member
#18
Preloading objects means preload static sources like fonts, css, javascript before these static are requested by html code. Also known as HTTP/2 Push: https://en.wikipedia.org/wiki/HTTP/2_Server_Push. LiteSpeed supports HTTP/2 Push, but the function to push sources must be developed for each applications in most cases. Maybe you find a plugin for your application if you use Wordpress.

Ads cannot and should not be preloaded. Ads and needed javascripts for ads should be loaded defered or async, so they don't block page rendering.
 
Top