Closed nvartolomei closed 9 years ago
Oh yeah you're right. I just checked it out in my test site.
$html_of_page = @file_get_contents($current_url);
This is where it fetches the html of the page so we can cache it
You understand what it takes twice amount of time generating a page to do this? As i said, also overhead for network transfer. Take a look at ob_start function. You can buffer content WP is generating and store it in redis.
This was to prevent logged in users caching as someone logged in, but I think I can check for the cookie and prevent logged in users from caching that way. Thanks for your help and suggestions.
Hello,
looks like you missed the point of WP Super Cache, probably W3 Total Cache too.
You try to compare 0.3s used to generate a page with your 0.009 used just to fetch cached page from redis.
For all 3 systems WP generated the same page ~ in the same amount of time, but when WP Super Cache serves the page it still displays original time it took for WP to generate the page, so it takes 0s to generate page and serves it right away from disk (probably disk cache), while your implementation still involves running php and querying redis.
I hope you understood.
Also what the hell is this?
Take a look at WP Super Cache source code and at ob_start function.