Caching period

Discussion in 'LiteSpeed Cache Module for PrestaShop' started by nicoX, Jun 10, 2018.

  1. nicoX

    nicoX Member

    I thought the module cached the site for a long period as set in the standard settings. I've been looking a long time for a solution for the delay my website has on its first request which can be anything from 4 to 20 seconds. This is the waiting time I have from the server which I noticed just allocated around 1.5kb/sec to load the Home Page which requires 15kb. So that will take it at least 10 seconds.
    Now APCu and other things help if you visited the site and instantly visit it again, then it will load within 3 seconds. But if you just wait some minutes the cache will flush what it is holding. I thought the Litespeed module would overcome this as it caches the site on the server, but no, now it holds it some more minutes, but if I don't revisit my site in lets say 15 minutes, it's like nothing is holding it in the cache and the server will go down to 1.5kb/sec again .
     
  2. Lauren

    Lauren LiteSpeed Staff Staff Member

    Did you enable the Guest Mode?
    Enable Guest Mode
    This will speed up the first page view for new visitors by serving the default view. Robots will get an instant response without hitting the backend. If you have different views based on GeoIP, select "First Page Only" to make sure the second page will have the correct view.​
    Otherwise, the first visit for a new user will always hit backend and that's pure PHP tuning. Use PHP7 and opcode cache will help.
     
  3. nicoX

    nicoX Member

    Yes it's set accordingly.
    It's just like it has its own life, many times I'm happy with the load time, other times I need to wait for 10 seconds. Doesn't make sense to me.
     
  4. Lauren

    Lauren LiteSpeed Staff Staff Member

    If the page was purged, then the first person hit it and go to backend and regenerate the page. To actually check if it's purged, you will need to turn on debug log in lscache for PS, then check the details there. but turn on debug log will slow down your site even more.
     
  5. nicoX

    nicoX Member

    I'm doing some tests...
    Every time I do a metrix test I get fine results. Under 3 seconds load of the site. But if I use my celllphone to access the site I have to wait 10+ seconds, and only with the cellpone (no issues with other sites when browsing with cellphone).
    The site is responsive and it's mobile friendly, but it's not a separate mobile theme, as I can tell... I can set specific setting for mobile view in the backend which I have, like not serving sliders for mobile devices, but I still don't consider it to be a separate theme, for me to enable the Litespeed cache setting for mobile view, though I might be wrong.
    I did a test with dareboost.com specifically for Mobile Speed Test, and those results where what I'm experiencing. As well it was complaining about redirects that took most of that time, 8-10 seconds for a http/https redirect. So I disable that in my .htaccess file, so now I think it's going well. But will do some more tests. But strange this only occurred on cellphone and not on my desktop.
    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
     
    Last edited by a moderator: Jun 11, 2018
  6. nicoX

    nicoX Member

    Seems that after removing the RewriteRule the mobile view is now loading properly and fast as well. Just don't understand why this had an negative effect on Litespeed.
     
  7. nicoX

    nicoX Member

    http://prntscr.com/jtmtqp

    14 seconds firsts request TTFB https waiting time...
    Happens occasionally, why is a question, the site is cached with Litespeed yet it needs to wait 14 seconds for the server is a mystery to me, even more that sometimes it loads within 2 seconds and other times it needs to wait 14 seconds.
     
    Last edited by a moderator: Jun 12, 2018
  8. NiteWave

    NiteWave Administrator

    I refreshed https://graphic-cv.com/ a few times, every time I can see x-litespeed-cache-control header
    but have noticed 4 values:
    Code:
    no-cache
    no-cache,esi=on
    miss
    hit
    in your screen shot ( http://prntscr.com/jtmtqp ), the value is "no-cache"
    this looks new to me as well. I thought either miss or hit, miss/hit should not coexist with no-cache for a single page for a guest visitor.
     
    Last edited by a moderator: Jun 12, 2018
  9. nicoX

    nicoX Member

    This is what I'm getting all the time in the browsers dev tools:

    Code:
    x-litespeed-cache: hit
    x-powered-by: PHP/7.0.30
    x-turbo-charged-by: LiteSpeed
    I'm always getting a HIT.

    My .htaccess's auto-generated code after installation of the module:

    Code:
    <IfModule LiteSpeed>
    CacheLookup on
    RewriteEngine on
    RewriteCond %{HTTP_COOKIE} !PrestaShop-
    RewriteRule .* - [E=Cache-Control:vary=guest]
    </IfModule>
    I don't see the X-Litespeed-Cache-Control in the HEADERS. So I have to do a metrics test for it to show up and yes it shows no-cache in the pingdom test but x-litespeed-cache: hit in the browser test.

    Enabeling opcache did infact help allot with the loading times getting good at the moment.
     
    Last edited: Jun 12, 2018

Share This Page