Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1427599

    Hi there,

    I’m having issues with the latest version(s) of the Enfold theme. The website is being hosted at SiteGround and I want to make use of their dynamic cache system. However the website can’t be cached due to a supposed theme issue.

    This is the reply from their tech department:

    As you can see, the no-cache is found under the “themes/enfold/config-layerslider/LayerSlider/assets/classes/class.ls.exportutil.php” and “themes/enfold/framework/php/wordpress-importer/avia-export-class.php[” theme files. Bear in mind that such headers in most cases are imposed by either a plugin(s) and/or themes.

    That said, I advise you to revise your theme and if required, contact the theme authors for further information on how to remove these no-cache headers from your website pages.

    Could you check this out if this is a possibility? I will post the URL in the private content.

    Regards,
    S

    #1427632

    Hey Enfoldfanatic,
    The two files that you mention are both export functions that only fire when the settings are being exported, the first one is when the LayerSlider export zip file is being created and the second one is for when the Enfold theme settings are being exported, in both cases you would not want the export to use cached files and neither of these run in normal site operations, so I don’t see how this could be an issue.
    Please feel free to remove these lines with the no-cache but be aware the export features may not work correctly.
    Also note that neither of these files can be added to a child theme so you will need to edit these files with each update.
    If you feel that this really needs to be changed in the theme the Dev Team has opened a new Github Feature Request for users to place requests and follow them as the Dev Team reviews them.

    Best regards,
    Mike

    #1427644

    Hi Mike,

    After providing your response to Siteground they came with another reply. Please find the reply in the private content.

    Regards,
    S

    #1427650

    Hi,
    In my research I find that this is added by WordPress, and to remove it try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

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

    Best regards,
    Mike

    #1427651

    Hi Mike,

    I added the code snippet to the functions.php but no succes unfortunately. For testing this topic I have cloned to the project to another environment, I will paste the link in the private content.

    Kind Regards
    S

    #1427653

    Hi,
    Try the other solution on the same page:

    add_filter('wp_headers', 'wpse167128_nocache');
    function wpse167128_nocache($headers)
    {
        unset($headers['Cache-Control']);
        return $headers;
    }

    or include an admin login so we can try.

    Best regards,
    Mike

    #1427654

    Hi Mike,

    I’m sorry the initial code snippet did had affect. It just needed a few seconds, the issue seems to be solved. Does this particular “issue” has something to do with the latest versions of Enfold and WordPress? This since I haven’t experienced yet earlier.

    Kind Regards,
    S

    #1427655

    Hi,
    Glad that this helped, I don’t know of anything that has changed in the theme, and I have not seen any other questions about this.
    Unless there is anything else we can assist with on this issue, shall we close this thread then?

    Best regards,
    Mike

    #1427657

    Hi Mike,

    Please feel free to close this thread, thank you very much for providing a working solution even on a Saturday evening.

    Kind Regards,
    S

    #1427658

    Hi,
    Glad we were able to help, 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 10 posts - 1 through 10 (of 10 total)
  • The topic ‘No caching option due to no cache issue’ is closed to new replies.