Page 1 of 1

Quick Cache + Multi-network?

PostPosted: September 3rd, 2010, 3:47 am
by LucPestille
Hi,
I'm using WP3 with @andrea_r's Networks+ plugin, to enable domain-mapping for my network of sites. I'm currently using W3 Total Cache, but it isn't completely compatible (it serves 1 site's content for any domain/network) - does QC have any issues with running multi-network sites, specifically with domain-mapping?

Also, since the plugin options are only set on the primary site, does this mean that I can't use the sitemap option (as each site will need it's own sitemap defined).

Thanks,

Re: Quick Cache + Multi-network?

PostPosted: September 7th, 2010, 4:00 pm
by Jason Caldwell
Thanks for the great questions.
Yes, Quick Cache IS compatible with Multisite Networking. While I've not tested with that particular plugin, I don't foresee any issues running Quick Cache with domain mapping.

Also, since the plugin options are only set on the primary site, does this mean that I can't use the sitemap option (as each site will need it's own sitemap defined).

Correct. I would suggest creating a special Sitemap specifically for Quick Cache,
which would include ALL sites in your Network.

Actually, my first recommendation is NOT to use the Auto-Cache Engine at all. That feature was added by request. As a developer though, I do NOT recommend it. The gains received by that particular feature are negligible. Unless you have a special reason to use that feature, I suggest leaving it off.
Quick Cache will run fine & dandy without it.

Re: Quick Cache + Multi-network?

PostPosted: September 7th, 2010, 4:30 pm
by LucPestille
Jason Caldwell wrote:Thanks for the great questions.
Yes, Quick Cache IS compatible with Multisite Networking. While I've not tested with that particular plugin, I don't foresee any issues running Quick Cache with domain mapping.

It does work OK - I've seen some weird CPU spikes, I think related to the cached files being re-generated, but other than that (and gzip not being enabled by default), it seems to work OK.

On that first note, why are cached pages re-generated every X seconds? If my homepage/posts don't change for hours or days on end, why should they be automatically re-generated and take up CPU time?

Thanks,

Re: Quick Cache + Multi-network?

PostPosted: September 8th, 2010, 12:54 am
by Jason Caldwell
It does work OK - I've seen some weird CPU spikes, I think related to the cached files being re-generated, but other than that (and gzip not being enabled by default), it seems to work OK.

^ Thank you VERY much for reporting back on this topic.

On that first note, why are cached pages re-generated every X seconds? If my homepage/posts don't change for hours or days on end, why should they be automatically re-generated and take up CPU time?

If your site rarely changes, then I would suggest increasing your Cache Expiration Time. I've seen site owners run this as high as 1 year ( 31556926 seconds ). In other words, the ONLY reason Quick Cache would re-generate Pages, is if your Expiration Setting requires it to do so, or you've configured Quick Cache with Dynamic Cache Pruning upon changes to your content within WordPress®.

If your Expiration Time is left at the default setting ( 3600 seconds = 1 hour ), then it will refresh the cache each hour ( on a per-Post basis ), looking for possible changes in your content. If you know that your content rarely changes ( i.e. you rarely edit posts, and you have no comments being left behind ), then you can safely increase your Expiration Time to dramatically decrease the amount of CPU time and bandwidth your server consumes.

Re: Quick Cache + Multi-network?

PostPosted: September 8th, 2010, 3:07 am
by LucPestille
Jason Caldwell wrote:If your site rarely changes, then I would suggest increasing your Cache Expiration Time. I've seen site owners run this as high as 1 year ( 31556926 seconds ). In other words, the ONLY reason Quick Cache would re-generate Pages, is if your Expiration Setting requires it to do so, or you've configured Quick Cache with Dynamic Cache Pruning upon changes to your content within WordPress®.

If your Expiration Time is left at the default setting ( 3600 seconds = 1 hour ), then it will refresh the cache each hour ( on a per-Post basis ), looking for possible changes in your content. If you know that your content rarely changes ( i.e. you rarely edit posts, and you have no comments being left behind ), then you can safely increase your Expiration Time to dramatically decrease the amount of CPU time and bandwidth your server consumes.

Is the cache re-generated per post when a comment is made, or would new comments always take "Expiration Time" to show up for regular visitors? Your comment suggests that a new comment doesn't count as a change? I might be an edge case, but I'd rather post content get updated rarely (say, every day) but comment changes update the post every hour...

Thanks though - without QC, my sites wouldn't be up at all!

Re: Quick Cache + Multi-network?

PostPosted: September 8th, 2010, 6:39 am
by LucPestille
Also, if QC doesn't use the root .htaccess to redirect requests, how does it work? Does it request something from the database for each request? I ask because whenever we get the smallest traffic spike, everything seems to fall over, or at least get very very slow - it seems to impact on the database more than I'd expect it to (which is not at all).

Thanks,

Re: Quick Cache + Multi-network?

PostPosted: September 27th, 2010, 3:30 pm
by Jason Caldwell
Thanks for the follow up.
Is the cache re-generated per post when a comment is made, or would new comments always take "Expiration Time" to show up for regular visitors?

New comments do NOT cause a cache refresh. The only factor that is considered is your Cache Expiration Time, which is 1 hour by default. That being said, if a visitor is commenting on your site, they will see updates to the spool of comments in real-time, because Quick Cache does not serve cached pages to logged-in visitors, and a recent commenter is considered a logged-in visitor.

Re: Quick Cache + Multi-network?

PostPosted: September 27th, 2010, 3:37 pm
by Jason Caldwell
Thanks for the great question.
Also, if QC doesn't use the root .htaccess to redirect requests, how does it work? Does it request something from the database for each request?

No, there are absolutely ZERO database requests required. By default, Quick Cache stores cache files based on the $_SERVER["REQUEST_URI"]. It can retrieve a cached version with only that information. If you're seeing a HUGE spike in database activity during peak times, that would indicate to me that there are several parts of your site that are not being cached for one reason or another.

- Visitors are logged in?
- Perhaps you have other plugins that are not cache-compatible?
- Your site uses query string arguments instead of friendly/SEO permalinks?
- Your cache expiration time is too low? Increase to 12 hours.

Re: Quick Cache + Multi-network?

PostPosted: March 7th, 2011, 2:32 pm
by catalyst
In my site i have a other issue.. my visitors dont need to be loged in to post a comment.. so they need to wait until the next cache clean up to see the comment, is there any way to solve this? some way to rewrite the for specific post when a coment is posted?

Re: Quick Cache + Multi-network?

PostPosted: March 8th, 2011, 10:24 am
by catalyst
anyone?

Re: Quick Cache + Multi-network?

PostPosted: March 10th, 2011, 3:36 pm
by catalyst
this is an issue that very users of this plugin should have..

Re: Quick Cache + Multi-network?

PostPosted: March 11th, 2011, 2:16 pm
by catalyst
I found a solution but after testing with several versions of wordpress and quick cache, to me only works with wordpress 3.0. + Quick Cache 2.2.7, and the solution is:

add this in yout theme functions:

Code: Select all
add_filter("comment_post_redirect", "ws_plugin__qcache_clear_on_post_page_comment", 10, 2);
function ws_plugin__qcache_clear_on_post_page_comment($location, $comment) {
   ws_plugin__qcache_clear_on_post_page_creations_deletions($comment->comment_post_ID);
   return $location;
}



then go to:

wp-content/plugins/quick-cache/includes/functions/clearing-routines.inc.php

and in line 32

replace with this:
Code: Select all
if (in_array ($pagenow, ($pages = array ("edit.php", "post.php", "post-new.php", "wp-comments-post.php"))))



and you are done. again to me only works in WP 3.0.4 + QC 2.2.7