Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #1428844

    Hello.
    My website is hosted on siteground and I see now for some time that the dynamic cache is not working due to “SKIP_CACHE_NO_CACHE” header that is present which basically instructs the website to bypass any caching. SG support confirmed that this is the reason why cache is not working. Also myself I have deactivate everything and use enfold alone and the problem stays the same. Using any other theme the problem disappears. We use enfold with WPML and for some years till today everything was ok. Unfortunately this issue is very important because the website is consuming very fast cpu seconds and we have already upgraded our hosting plan and soon this will not be enough also.

    #1428855

    Hi,

    Does enabling the “Delete Old CSS And JS Files?” option in the Enfold theme options > Performance make any difference?

    Please see my message in the private content field.

    Regards,
    Yigit

    #1428857

    Yigit thnk you for answering
    enabling the “Delete Old CSS And JS Files?” option in the Enfold theme option has absolutely no effect on the problem. Please note that the dynamic caching on siteground works together with a speed optimizer plugin made by them. As I said this was working fine for years and suddenly stopped having as a result the site to b slow and consuming huge resources

    regards
    John

    #1428861

    Hi,

    Thanks for the update. What happens if you turn file compression off under Enfold->Performance? There’s really no point in having it active anyway, since your plugin should do that for you.

    Best regards,
    Rikard

    #1428864

    Hi Rikard thank you for answering
    I did try this before and I have repeat this action after your response by disabling CSS File Merging And Compression and Javascript File Merging And Compression, unfortunately with no result.

    #1429188

    Hi,

    Sorry for the late reply. We are not sure what is causing your problems unfortunately, but maybe it’s the same problem as in this thread? https://kriesi.at/support/topic/no-caching-option-due-to-no-cache-issue/

    Best regards,
    Rikard

    #1429318

    Hello and happy new year
    Following your suggestion I have added the code below

    function varnish_safe_http_headers() {
        header( 'X-UA-Compatible: IE=edge,chrome=1' );
        session_cache_limiter('');
        header("Cache-Control: public, s-maxage=120");
      if( !session_id() )
      {
        session_start();
      }
    }
    add_action( 'send_headers', 'varnish_safe_http_headers' );

    this function actually gave me some result but not the proper one. After applying this function the siteground cache system periodically works but mostly not. This means that randomly the same url sometimes is cached and some times is not. So the cache is still not working properly. I have asked SG to further investigate this issue and after monitoring the gave this information that you see in private.

    • This reply was modified 5 months ago by John.
    #1429426

    Hi,
    Reading what you wrote in private, I don’t think that you can completely remove the WordPress session PHPSESSID, which is what you webhost seems to be asking.
    I see that you are using the cookie bar on the site, try disabling this and see if you have the same issue.

    Best regards,
    Mike

    #1429499

    Hello again and thank you for answering
    I did what you said and the problem is not solved. I asked again SG to monitor the site and you can see the answer in private.
    Thank you in advance

    #1429500

    Hi,
    Thanks for the feedback, since you have disabled the Enfold cookie bar the only PHP Session cookie that is now applied is the WordPress PHPSESSID, I don’t believe there is anyway to completely remove this. This is beyond what we can help you with since it is a basic WordPress function, and I’m not sure that WordPress will work correctly if you were able to remove this.

    Best regards,
    Mike

    #1429501

    I must say to you that any other theme works perfectly fine with SG cache. I can’t b sure if GS reports are 100% accurate about the cause i am just transferring information from one to another.

    The only thing that is clear to ne is that this is happening with enfold

    #1429503

    Hi,
    Well from what they are writing they want the standard WordPress PHPSESSID to be removed, perhaps they are giving you bad information because I can’t see that any other theme would do this.

    Best regards,
    Mike

    #1429504

    hi
    this is the response of SG

    By default, WordPress is a stateless application, meaning that it should not have session cookies on the landing pages, as each session is carried out as if it was the first time and responses are not dependent upon data from a previous session. This however changes when you have pop-ups on the landing page for example, which needs to track whether the visitor has clicked on any of the options of the pop-up, as is on your website for the notifications pop-up, which loads on the landing page of the website. Though this is an example and should be looked at the plugin configurations on your end as well, as it could be set by any of the extensions that you are utilising on the website.

    Sessions cookies should only be used on login pages, for example when you are accessing your Dashboard, where content correctly should not be shown from cache, but should be loaded Dynamically on the website.

    #1429505

    Please note that the problem stays the same even when I’m deactivating all plugins

    #1429514

    Siteground thankfully is continuing to monitoring the problem and they gave me this extra information that you see in private. Please check this carefully to clarify before I do any changes

    #1429551

    Hi,
    The function that they posted:

    function varnish_safe_http_headers() {
        header( 'X-UA-Compatible: IE=edge,chrome=1' );
        session_cache_limiter('');
        header("Cache-Control: public, s-maxage=120");
      if( !session_id() )
      {
        session_start();
      }
    }
    add_action( 'send_headers', 'varnish_safe_http_headers' );

    is the function that you added from this post above.
    Which is from this Stack Exchange solution to override the WordPress default PHPSESSID to solve issues with a Varnish server.

    Best regards,
    Mike

    #1429552

    Hi
    Of course i know what this is I just transferring the message.
    Should i add this code to functions-enfold.php instead of functions.php?

    #1429591

    Hi,
    No, you should not add any code to the functions-enfold.php
    Any customizations that you wish to add should be in your child theme functions.php
    The way that I read the message from SG, there are no session cookies being assigned with this code in place, this seems to support the Stack Exchange solution replies for Varnish servers.
    But when they checked again after about 30 minutes there was a session cookie, this seems to be due to the time limit in the code: s-maxage=120
    So since this seems to show that the issue is between the SG cache and the WordPress PHPSESSID, I would recommend asking SG what they recommend the time limit in the code should be to work with their server cache.

    Best regards,
    Mike

    #1429657

    Hello
    The answer from siteground to your last question is that there is no recommended time limit when it comes to the HTTP header cache-control: max-age or cache-control: s-maxage

    Today the gave me after monitoring all this time even more detailed information that you can see in private. Please review carefully and try to give me a solution for your part.

    #1429709

    Hi,
    As I read their report he PHPSESSID cookie is defined by the wp-content/plugins/sitepress-multilingual-cms/
    So I guess your SG cache is not campatable with the WPML plugin and you should disable it.
    They say that they found a no-cache in the /wordpress-importer/avia-export-class.php but this is only used when you export the theme settings, these files are only loaded on the backend when you perform an export of the theme files. If you want to manually remove this from the theme you can by editing the files below, but the theme export feature may not work correctly and you will need to edit these files after each update. As it stands now SG says you won’t be able to use a cookie notification, or the WPML plugin and you will need to modify the export feature, in order to use their cache. Perhaps you should look into a cache plugin like WPRocket or WP Fastest Cache, neither of these have this issue with WPML or Enfold.

    If you want to manually modify your files look for header(‘Pragma: no-cache’); in:
    \enfold\config-layerslider\LayerSlider\assets\classes\class.ls.exportutil.php ▸ line 178
    \enfold\framework\php\wordpress-importer\avia-export-class.php ▸ line 215

    Best regards,
    Mike

    #1438415

    UPDATE
    Dear Mike
    I tried many times to fix this issue my self and also with the help of other professionals but the outcome was always the same, we could not make enfold work together with SG cache system. So we decided to leave SG and now the website is hosted in other provider with no problems regarding there cache.

    #1438423

    Hi,
    Thank you for the update about the SG cache system, I don’t know why this was an issue, but I’m glad that you have it sorted out now, and now your site is working well with no issues.
    Thanks for sharing your experience, perhaps this will help future users that are using the SG cache system.
    If you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘cache not working’ is closed to new replies.