• fokus3

    (@fokus3)


    Hi,

    today I’ve noticed a “big problem”. I have to modify the HTML-code after the entire page has been rendered completely. Therefore I’m using a code like this:

    function callback($buffer) 	{	return $buffer;	}
    function buffer_start() 	{	ob_start("callback");	}
    function buffer_end() {
    
    	ob_end_flush();
    	$content = ob_get_clean();
    
    	[...do my stuff...]
    }
    add_action('wp_head', 'buffer_start');
    add_action('wp_footer', 'buffer_end');

    On the first call of the page everything works fine. But after the first call the WPFC generated cached file is loaded and all my changes are gone.

    In other words: WPFC writes the cache file before the page has been finished its rendering. That’s a big problem, because I have to do my code changes at the end of the page generation process – but BEFORE WPFC is writing the cache file.

    How can this be done?

    Thx for you help!
    best regards,
    Lars

    https://www.ads-software.com/plugins/wp-fastest-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Emre Vona

    (@emrevona)

    You can’t do this ?? because WPFC get the buffer. Can you tell me what you wanna try with this code? Maybe I can help you.

    Thread Starter fokus3

    (@fokus3)

    This is a bit complicated to describe. I have some other software components which are not part of WordPress. So I want to take the generated WP content and modify it before its written to the cache… A WPFC filter function (hook) would be very helpful ??

    Plugin Author Emre Vona

    (@emrevona)

    ow I got ?? I can’t promise for adding this feature. As you see, WPFC has +100.000 active users and first time I see such feature request ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to hook WPFC’ is closed to new replies.