Hi everyone,
I’ve been working with the Easy Form Builder plugin and encountered some challenges with page caching. To address these, we’ve implemented the following function to manage the interaction between Easy Form Builder and various page caching plugins:
public function cache_cleaner_Efb($page_id, $plugins) {
$page_id = intval($page_id);
$cache_plugins = json_decode($plugins);
foreach ($cache_plugins as $plugin) {
switch ($plugin->slug) {
case 'litespeed-cache':
if (defined('LSCWP_V') || defined('LSCWP_BASENAME')) do_action('litespeed_purge_post', $page_id);
break;
case 'wp-rocket':
if (function_exists('rocket_clean_post')) $r = rocket_clean_post($page_id);
break;
.
.
.
}
}
}
While this works, we’re looking for a more streamlined or integrated solution, ideally similar to how other plugins handle caching. Any suggestions on best practices or methods to improve this would be greatly appreciated.
Thank you for your time and insights!
Best regards,
]]>Hello, Speed Up Support Team,
I’m developing a performance improving plugin and have a specific caching requirement.
I need pages and posts not to be cached on first open, after they are created or edited.
I need to examine the page with all the JS and CSS implemented, then edit the HTML before it can be cached. So, the page should be cached on the second visit.
Is there a built-in feature or specific hook in Speed Up that supports this functionality, and can be controlled through PHP?
I am considering a custom implementation using WordPress hooks. Here’s a brief overview of my approach:
// Function to update a custom field when a post or page is saved
function update_last_modified_meta($post_id) {
update_post_meta($post_id, '_last_modified_time', current_time('mysql'));
}
add_action('save_post', 'update_last_modified_meta');
// Function to control caching based on the last modified time
function custom_per_page_cache_control() {
if (is_single() || is_page()) {
global $post;
$stored_last_modified = get_post_meta($post->ID, '_last_modified_time', true);
if ($post->post_modified !== $stored_last_modified) {
// Send headers to prevent caching
header("Cache-Control: no-cache, must-revalidate, max-age=0");
header("Pragma: no-cache");
header("Expires: Wed, 11 Jan 1984 05:00:00 GMT");
update_post_meta($post->ID, '_last_modified_time', $post->post_modified);
}
}
}
add_action('template_redirect', 'custom_per_page_cache_control');
Is this approach is compatible with your plugin? Is there a solution specific to your plugin?
Any recommendations or best practices for implementing this would be greatly appreciated.
Thank you,
Jovan
]]>Hi,
I’m unsing your plugin on several sites for a long time, thanks for it ! I was just wondering if the plugin status will be updated to support the latest wordpress version (currently 5.7) or is it not being developed any more ?
Thanks
]]>Didn’t work for me, I’m on namecheap shared hosting.
]]>Hi,
I installed the Plugin after Google Speed index tolds me that I have to enable browser Caching – but it still shows Browser Caching / Speed-Problem. Any idea? Thx in advance
]]>I’m using Speed Up – Browser Caching.
Installed the plugin and tried to activate it.
I’m getting the following:
Plugin could not be activated because it triggered a fatal error.
Fatal error: Class ‘SELF’ not found in /var/www/html/dev.scotthorton.org/wp-content/plugins/speed-up-browser-caching/speed-up-browser-caching.php on line 55
I’d be happy to provide other feedback, php-info… whatever if you need it.
]]>