Fragment Cache Error

Hello, does Cornerstone not support ‘Fragment Caching’?
I get this error: ‘The preview could not load. This is most often related to a plugin conflict or aggressive page cacheing. Checking the developer console for errors could indicate what went wrong.’ when I activate fragment caching (on Borlabs Cache) on my site.

Hi There,

Thanks for writing in!

Please check in the cache plugin setting if there is something to disable it for admin users, and test if that works for you.
It always advice to disable the cache when you are doing some changes or editing pages for best result.

Hope this is clear to you.

Thanks

I did disable it for logged-in users, but the error persists.

Hi there,

The important point that you need to consider in using Cache plugins with Cornerstone is that you need to exclude the Cornerstone JS and CSS files from those caching functionalities. The files of the Cornerstone are all minifyied by default. That is why if a cache plugin tries to minify that file again it will throw the error.

kindly get back to us with the URL/User/Pass of your WordPress dashboard using the Secure Note functionality of the post to follow up the case.

Tell us wich plugin we should check for testing puposes.

Thank you.

Hello,

I did turn off minification of CSS and Javascript, but I still got the error.

Hi there,

I followed the instructions you gave and tested the case with Borlabs cache. Upon checking the about us page I see that there is an internal server error 500:

Please enable the WordPress Debug mode to see the actual error.

Also, you need to contact your hosting service provider and ask them to check the error log for the more detailed error instead of the 500.

The fact that another 3rd party plugin has an option for the Borlabs cache shows that the cache plugin provides an action of some kind that can be used to exclude the Cornerstone files.

Please also, contact the Borlabs Cache developers and get the information on which Action (Hook) we need to use to exclude Cornerstone assets.

Thank you.

Hi,

I got a reply from Borlabs Cache.

"When Fragment Caching is active, every other plugin that uses the PHP function ob_start(); and defines a callback for the handler like ob_start(‘myCallback’); doesn’t work due technical limitations within PHP.
They need to change their code and close their buffer by using the WordPress hook wp_footer. WP SEO for example does this.
WP SEO checks if Borlabs Cache is running with activated Fragment Caching and instead of starting the buffer with a callback function, they start the buffer without a callback function and use the wp_footer hook to capture and close their buffer.

AdRotate places its php function to get the code of an ad within the fragment caching phrases."

Thanks

Hi there,

Cornerstone does use ob_start(), but with no callbacks. But I like to confirm and test it if it’s buffer issue, would you mind providing your FTP login credentials as well?

Thanks!

Okay, it’s attached.

Thanks.

Hi there,

Thanks, I did some testing and it looks like it’s not due to ob_start(), I did as suggested and added this code to your child theme’s functions.php


add_action('wp_footer', 'close_buffer', 99999999 );

function close_buffer () {

@ob_end_clean();

}

And even edited the core files of the cornerstone to immediately call ob_end_clean() to close the buffer but it’s still the same. Perhaps, it’s just to the cache itself, this can happen to any cache plugin, even with CloudFlare’s caches. And sometimes, caches are unpredictable and hard to trace. Perhaps you can choose a different cache plugin to choose? I may continue checking.

Thanks!

For some reason, I don’t have access to the site anymore. Could you restore it?

I’m only getting a blank page.

Hi there,

Please try to login through FTP and edit the wp-config.php file and fine the line define( 'WP_DEBUG', false ); and set it to false then reload your site again.

It should display the error if there is any which should give you an idea what is causing the white screen.

Let us know how it goes.

Hello,

I did end up resolving the issue.

Also, I deleted:

add_action('wp_footer', 'close_buffer', 99999999 );

function close_buffer () {

@ob_end_clean();

}

as it was causing issues on my site. Is there anything else I need to change?

Thank you.

Hi there,

Please contact the plugin developer and give the code that my colleague suggested. Ask them to advice and tell us what to do next.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.