Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1429626

    Hi,
    I’m testing the SiteGround CDN cache that works based on headers, and inspecting the returned headers I get a x-proxy-cache: MISS (see link in private content).

    Siteground support suggested to contect you to review the code of the theme and assist in fix the issue (see link in private content).

    Please help.
    Thanks,
    Francesco.

    #1429748

    Hey Francesco,
    Thanks for your patience the file that the report seems to point to: /wp-content/themes/enfold/includes/helper-privacy.php
    is for the theme cookie settings, but it doesn’t look like you are using the theme cookie settings on your site, it looks like you are using a third party cookie manager.
    The cookie PHPSESSID is the default WordPress session cookie.
    I would first recommend disabling all of your plugins including your third party cookie manager and check again.
    In another thread the SiteGround support has said that the WPML plugin uses the WordPress PHPSESSID and this leads to the SiteGround cache to fail, so your third party cookie manager, or another plugin may also be doing the same on your site.
    Since you are not using the Theme cookie settings the file above would not be loaded, but please check the settings at Enfold Theme Options ▸ Cookie Consent ▸ Cookie Consent Message to ensure that you have this disabled, perhaps you are using a combination of the two that I don’t know about.
    I would also point out that in another thread the SiteGround support has said that the files at:
    \enfold\config-layerslider\LayerSlider\assets\classes\class.ls.exportutil.php ▸ line 178
    \enfold\framework\php\wordpress-importer\avia-export-class.php ▸ line 215
    contain the line header(‘Pragma: no-cache’); and this also causes the SG cache to fail, but these files are only loaded in the backend when a admin exports the theme settings, so this would not be loaded on the frontend or be a part of a cache.
    You can try to manually remove these line to see if this helps your situation.
    If it does then perhaps the SG cache is adding backend files to the cache in error.
    Another solution that one user found helpful was to add this code to the child theme functions.php, which is from this Stack Exchange solution to override the WordPress default PHPSESSID to solve issues with a Varnish server.

    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' );

    Hopefully one of these suggestions will help you, it’s kind of a hard issue because each SiteGround support tech points to a different cause, but they all seem to point to the WordPress default PHPSESSID breaking the SG cache.

    Best regards,
    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.