Fully cache database

Discussion in 'General' started by JulienBayonne, Apr 22, 2018.

  1. JulienBayonne

    JulienBayonne Active Member

    Hello

    As visitors our website, vitadesign.ch, do not interact with the database of it I want to fully cache it and wondered if pr how this is done?

    If I can enable it with Litespeed Cache plugin on my Wordpress website or on another way there, is there something to do on Cloudflare as I do not know actually how this CDN is interacting with the website here? The nameservers point to Cloudflare, yes.

    Regards

    Julien
     
  2. JulienBayonne

    JulienBayonne Active Member

    I heard it is called "updated caching" for databases.
     
  3. Pong

    Pong Well-Known Member Staff Member

    seems a little strange term "updated caching" for databases but it has nothing to do with LiteSpeed.
    The way of cache working is to avoid php and mysql processes and serves your web pages from cache. Is that something you want to achieve? Enabling cache should have done it already.
     
  4. JulienBayonne

    JulienBayonne Active Member

    Thanks for your answer.

    The problem I have is that my websites, even if having a good pagespeed on GTmetrix or Pingdom, are loading slowly I noticed when loading them the first time on a new PC in a browser where they haven't been open before, means nothing of them was cached on the PC. I noticed these long load times also on Pingdom: https://tools.pingdom.com/#!/dQgp8X/vitadesign.ch

    I've done stuff like minyfing and merging codes, put scripts in footer, defer JS etc., also using Cloudflare and put there in a pagerule to cache everything.

    My question is now how to maybe setup this full caching, making site completely static, means if I change something the Wordpress editor it will not appear on display of the website without purging, for my website, not only via Cloudflare?

    Or would you evtl have any other tip or solution? I can also hire an expert to help me out.

    Kind regards

    Julien
     
  5. JulienBayonne

    JulienBayonne Active Member

  6. Pong

    Pong Well-Known Member Staff Member

    Last edited by a moderator: Apr 25, 2018
  7. JulienBayonne

    JulienBayonne Active Member

    Thanks for your answer.

    From my side it shows Litespeed Cache is enabled, at least it is what this Wordpress plugin tells me:

    [​IMG]
    Maybe you did not see cause I purged all Cache recently there, like on Cloudflare where also Development Mode was maybe enabled.


    For the HTTPS redirect I finally one via Cloudflare, still on Pingdom there are differences sometimes, maybe the HTTPS redirecting wasn't the big issue. Especially I see these differences in for a file called includes.min.js:

    [​IMG]

    Well I guess in this file is the most of the JS codes, minfied. I allready put them out of header, also I enabled defering of JS with the Litespeed Cache WP plugin. Any suggestion?


    On Cloudflare I added rules to cache everything, I wondered how to do it on my website or if necessary when enabled already trough Cloudflare. Also I can add HTTP push with Cloudflare like this way I have read: https://support.cloudflare.com/hc/e...w-do-I-enable-HTTP-2-Server-Push-in-WordPress


    Any further advice you'd have evtl. for me?

    Regards

    Julien
     
  8. Tishu

    Tishu Well-Known Member

    You may wanna track why this file ( https://vitadesign.ch/wp-content/themes/astra/js/min/includes.min.js ) is redirecting to the index.
     
    Last edited by a moderator: Apr 25, 2018
  9. JulienBayonne

    JulienBayonne Active Member

    Thanks. This redirecting is done cause I added this code in the 404.php file in order to do not have 404 pages displayed:
    PHP:
    <?php
    header
    ("HTTP/1.1 301 Moved Permanently");
    header("Location: ".get_bloginfo('url'));
    exit();
    ?>
    Do you think this may have caused this long loading time issue? Looking at results from Pingdom it seems so, but they have often huge changes.

    Kind regards

    Julien
     
    Last edited by a moderator: Apr 25, 2018
  10. Tishu

    Tishu Well-Known Member

    Hello again,
    Your theme is searching for that file and for some reason its not there. You may wanna check why is not there and if this is default file for that theme.
     
  11. JulienBayonne

    JulienBayonne Active Member

    I just noticed on the last Pingdom test that it shows a warning symbol. Also I note that this file was even before also at a size of 0 bytes. Well here is a screenshot:
    [​IMG]

    I just have ssen that when ejtering the link, https://vitadesign.ch/wp-content/themes/astra/js/min/includes.min.js, a page comes saying page was not found, I guess it is what is called a 404 landing page.

    The file comes from the Astra theme I guess as it is written in the URL, I'll contact their support.

    Regards and thank you

    Julien
     
    Last edited by a moderator: Apr 25, 2018
  12. Pong

    Pong Well-Known Member Staff Member

    I did not see cache hit header, so you cache is not enabled properly yet. You need to talk to your hosting company. If it is vps managed by yourself, you should closely follow our wiki until you see cache hit header.
     
  13. JulienBayonne

    JulienBayonne Active Member

    Thanks for your answer.
    I have seen this line in the response headers of the second request of the website ( first one is for a redirecting to https):

    status: 200
    expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    content-encoding: br
    set-cookie: __cfduid=d46aa4e039656a440b68deaff4a7c30401524771921; expires=Fri, 26-Apr-19 19:45:21 GMT; path=/; domain=.vitadesign.ch; HttpOnly; Secure
    x-litespeed-cache-control: public,max-age=604800
    x-powered-by: PHP/7.0.29
    vary: Accept-Encoding
    cf-h2-pushed: </min/f5f46.css>,</wp-includes/js/jquery/jquery.js>,</wp-content/plugins/elementor/assets/lib/swiper/swiper.jquery.min.js>,</min/faa4e.js>,</min/css_async.js>
    server: cloudflare
    x-litespeed-tag: c521_URL.6666cd76f96956469e7be39d750cc7d9,c521_F,c521_Po.2,c521_PGS,c521_
    x-turbo-charged-by: LiteSpeed
    date: Thu, 26 Apr 2018 19:45:22 GMT
    cf-ray: 411b8c9eeb57579b-IAD
    alt-svc: quic=":443"; ma=2592000; v="35,37,38,39"
    content-type: text/html; charset=UTF-8
    x-pingback: https://vitadesign.ch/xmlrpc.php


    On the response headers of the following request for a CSS file I read:

    cache-control: public, max-age=604800

    expires: Thu, 03 May 2018 19:45:23 GMT
    last-modified: Wed, 25 Apr 2018 16:11:58 GMT
    vary: Accept-Encoding
    alt-svc: quic=":443"; ma=2592000; v="35,37,38,39"
    x-turbo-charged-by: LiteSpeed
    cf-cache-status: EXPIRED

    Here the test I run: http://www.webpagetest.org/result/180426_J3_19c55867658f5edc7e7f842fabcabd00/2/details/#step1_request2


    Well I am not at all a caching expert, I see no X-Litespeed-Cache:hit however. So I wanted to ask you if you could evtl help me further please of what could I tell to the hoster exactly? Any link to a documentation of your Wiki for that evtl please?

    I have a subscritpion of a cloud hosting at TMDHositng, no VPS. Also note that nameservers are the ones of Cloudflare that I use if this is of importance to know here.

    Kind regards and really appreciate

    Julien
     
    Last edited by a moderator: Apr 30, 2018
  14. Tishu

    Tishu Well-Known Member

  15. Pong

    Pong Well-Known Member Staff Member

    Your host should be able to help you for troubleshooting. If they have any question, they can logged a ticket with us with tmp root password for the server.
     
  16. JulienBayonne

    JulienBayonne Active Member

    Thanks. I run a fast test with http://www.webpagetest.org and noticed that most requests have a cf-cache-status: HIT respond header that shows that it is cached by Cloudflare. Here is the full test if of interest: https://www.litespeedtech.com/support/forum/threads/fully-cache-database.16284/

    These requests did not contain a HIT code:
    Code:
    https://ajax.cloudflare.com/cdn-cgi/scripts/935cb224/cloudflare-static/rocket.min.js
    https://fonts.googleapis.com/css?family=Poppins:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic%7CRoboto:100,100italic,2
    https://vitadesign.ch/cdn-cgi/pe/bag2?r[]=https%3A%2F%2Fvitadesign.ch%2Fwp-includes%2Fjs%2Fjquery%2Fjquery.js&r[]=https%3A%2F%2Fvitadesign.ch%2Fwp-content%2Fthemes%2Fastra%2Fjs%2Fmin%2Fincludes.min.js&r[]=https%3A%2F%2Fvitadesign.ch%2Fwp-content%2Fplugins%2Felementor%2Fassets%2Flib%2Fswiper%2Fswiper.jquery.min.js&r[]=https%3A%2F%2Fvitadesign.ch%2Fmin%2Ffaa4e.js
    https://vitadesign.ch/cdn-cgi/pe/bag2?r[]=https%3A%2F%2Fvitadesign.ch%2Fwp-includes%2Fjs%2Fwp-emoji-release.min.js
    https://vitadesign.ch/wp-content/themes/astra/js/min/includes.min.js
    Other JS file requests also show however a cf-cache-status: HIT code, as it can be seen in the test results.

    Regards

    Julien
     
    Last edited by a moderator: Apr 30, 2018
  17. JulienBayonne

    JulienBayonne Active Member

  18. JulienBayonne

    JulienBayonne Active Member

    Ok a staff member told me this:
    Usually when you see header like this x-litespeed-tag: c521_URL.6666cd76f96956469e7be39d750cc7d9,c521_F,c521_Po.2,c521_PGS,c521_
    It means your cache root is not properly set up



    I contact my hoster so.
     

Share This Page