It seems that you’ve unchecked option Don’t cache pages for known users. (WPSC settings/Advanced). You can’t exclude only “header” because WPSC created fully static HTML page. It’ll work if you deactivate caching for all logged users (which is usual setting).
Also, it seems that you website is behind Cloudflare and it’s possible that isn’t WordPress issue. You should “bypass cache” for logged users (cloudflare settings) and you can see more details on https://support.cloudflare.com/hc/en-us/articles/236166048-Caching-Static-HTML-with-WordPress-WooCommerce.
I have that option ticked (“Don’t cache pages for known users”)
Indeed when i disable cloudflare the issue does not occur for logged in users
However the Cloudflare setting “bypass cache on cookie” is not available on their free plan. What is the plan B? Do you recommend to disable cloudflare performance?
The main issue here, when you visit a cache page you can’t login using the Tonda theme login widget at the top (as shown in the screenshot)
I think that simple solution is removing Cloudlflare. You could use free CDNJS for JS/CSS files (to improve loading time) and CDN only for images (I don’t know does it exist for free plan). Also, preload option (it regenerates entire cache at each nnn minutes) in WPSC could help for anonymous visitors.
Related to login popup, it seems that Tonda theme uses JS/AJAX request. It should work, but it’s possible that CF stores/serves “wrong pages” because it doesn’t check WP cookies.
You should test with/without CF and then compare performance improvements. Also, you will see is it fixing this issue.
I do not know if it’s Cloudflare problem, I tried to pause it and sometimes it works sometimes not. I have used chrome, edge and firefox. On firefox sometimes there is problem on the cached pages.
Even with Cloudflare enabled sometimes the login works. When paused sometimes does not work.
I am confused can you help me diagnose this issue ?
I see double “Cache-Control” in HTTP headers:
Cache-Control: max-age=3, must-revalidate Cache-Control: max-age=172800
First (max-age=3) is sent by WPSC, second it seems as custom server rule (172800 seconds=2 days). I think that isn’t CF issue (by quick checking). It could be issue because browser keeps old file and it doesn’t try to retrieve new page from the website.
I’m not sure that pausing is enough. Anyway, you should remove double Cache-Control from HTTP header. Also, you should enable ETag if it’s possible.
Related to blank pages, please enable debugging in WPSC (WPSC Settings/Debug) and check PHP error log (enable this log if it isn’t enabled) and apache log. More details: https://www.a2hosting.com/kb/cpanel/cpanel-logging-features/error-log
i am also using Clearfy plugin but i do not think it’s the issue i tried to disable it as well.
- This reply was modified 3 years, 8 months ago by csandreas1.
How can i enable ETag? Can i just add expire headers?
Related to expire headers – it’s an issue because second ‘Cache-control’ increases ‘Expires’ to current time + 2 days. So, you should check .htaccess and remove rule for Cache-Control: max-age=172800.
Related to ETag – you need to remove
Header unset ETagfrom .htaccess (if it exists) and add
FileETag MTime Sizeinstead of
FileETag None(maybe it doesn’t exist).
Did you add custom rules in .htaccess related to leverage browser caching or something like this?
Here is my complete htaccess file
We haven’t figured out the issue yet and i am about to uninstall this plugin :/
An other issue “preloading” does not preload all pages unless i do it manually… i have checked folder and there are pages missing. (my website has only 100 pages)
I don’t see more double HTTP header, so it seems that you fixed it. I think that you don’t need extra rules for “certificate validation” in WordPress section of
.htaccess(removing could little decrease time for processing of request and it should work without it).
Because your website is behind Cloudflare then you could try without any WP caching plugin. It’ll be helpful to enable OPCache in PHP configuration (sometime it’s available for shared hosting, but you could ask your hosting for more details). Loading time of pages is longer than usual for similar websites (and PHP 7.2).
Regarding to preload (and other task in backend), it’s helpful to run wp-cron.php from real cron service (I recommend at each 5 or 10 minutes). More details – How to configure a cron job for WordPress.
If you open the console you will notice that the JS/AJAX request is not sent on cached pages. ON INCOGNITO IT WORKS THOUGH, have we splitted the issue enough or not yet?
- The topic ‘How to stop header from being cached?’ is closed to new replies.