-
AuthorPosts
-
December 24, 2023 at 10:17 am #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.December 24, 2023 at 6:38 pm #1428855Hi,
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,
YigitDecember 25, 2023 at 7:08 am #1428857Yigit 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 resourcesregards
JohnDecember 25, 2023 at 12:43 pm #1428861Hi,
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,
RikardDecember 25, 2023 at 6:16 pm #1428864Hi 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.January 3, 2024 at 4:51 pm #1429188Hi,
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,
RikardJanuary 5, 2024 at 1:47 am #1429318Hello and happy new year
Following your suggestion I have added the code belowfunction 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 11 months, 3 weeks ago by John.
January 6, 2024 at 6:51 pm #1429426Hi,
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,
MikeJanuary 7, 2024 at 10:52 pm #1429499Hello 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 advanceJanuary 7, 2024 at 11:23 pm #1429500Hi,
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,
MikeJanuary 7, 2024 at 11:30 pm #1429501I 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
January 8, 2024 at 12:06 am #1429503Hi,
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,
MikeJanuary 8, 2024 at 12:53 am #1429504hi
this is the response of SGBy 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.
January 8, 2024 at 1:06 am #1429505Please note that the problem stays the same even when I’m deactivating all plugins
January 8, 2024 at 3:19 am #1429514Siteground 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
January 8, 2024 at 12:44 pm #1429551Hi,
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,
MikeJanuary 8, 2024 at 12:57 pm #1429552Hi
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?January 8, 2024 at 6:29 pm #1429591Hi,
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,
MikeJanuary 9, 2024 at 6:56 pm #1429657Hello
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-maxageToday 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.
January 10, 2024 at 12:14 pm #1429709Hi,
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 215Best regards,
MikeMarch 27, 2024 at 9:11 am #1438415UPDATE
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.March 27, 2024 at 11:02 am #1438423Hi,
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 -
AuthorPosts
- The topic ‘cache not working’ is closed to new replies.