Info
- 21 posts
- 11 voices
- Started 4 months ago by JohnConners
- Latest reply from martin128
- This topic is not resolved
Getting WP Super Cache / W3 Total Cache to work with bbPress 2.0
-
- Posted 4 months ago #
Is there anything I need to do to get the aforementioned caching plugins to invalidate topic pages, forum indexes and so forth when a new reply is posted?
I've tried both 2.0.2 and the latest bbPress plugin version from svn and as it stands, posting a new reply does not clear the topic page (or any other forum pages) from the cache so you and nobody else sees your replies.
Just wanted to check if it's currently a bug / feature or I'm missing something obvious!
-
- Posted 4 months ago #
Assuming it's a static page cache that isn't being invalidated? Seems odd the post and meta update wouldn't flush the object and query cache automatically.
-
- Posted 4 months ago #
Yeah, that's right. Agreed, I assumed it would work too so figured I should check if I was missing something. Will have a look and see what's going on.
-
- Posted 4 months ago #
Any updates?
-
- Posted 4 months ago #
So I can get both of these cache plugins to work by hooking into a few actions in bbPress and invalidating the post (which may be a topic or forum) and any ancestors (which would be a topic / forum in the case of a reply) by doing the 'edit_post' action on each post. There are a couple of edge cases still to deal with (like subscribing to a topic that needs your user page invalidating) that I'll have a look at this evening.
Only real thing I don't have an answer to is the freshness count. If you view a forum and the last topic was posted 1 minute ago then you come back an hour later and refresh the page you'll see the cached page stating that the last topic was posted 1 minute ago rather than an hour ago. I could go with the fixed date approach but it's not as neat.
-
- Posted 3 months ago #
Just wondering about this.
Is W3TC "safe" to use with bbPress 2.0?
-
- Posted 3 months ago #
If there are places where bbPress is not busting the cache properly, I'll need your help to figure out where and why. bbPress currently relies heavily on WordPress's API's to do this for us. bbPress runs very few manual queries of its own, and new or edited posts should be busting the cache automatically.
-
- Posted 3 months ago #
Regarding all the relative times (x minutes ago, etc), the best solution would probably be to put absolute times into all those places, along with some javascript to turn it into a friendly relative time at the client end.
As well as being cache-friendly, this solution would allow the possibility of locally updating, so if you switch to another tab in the browser and switch back a few hours later, the "1 minute ago" can change to "3 hours ago".
-
- Posted 3 months ago #
JJJ: Ok, I'll put together the list of actions / filters I've used to get cache invalidation working when I get back to my home machine (then hopefully you can say "no no no, all you needed to do was this..."). Is this forum post the best place or a trac ticket?
CiaranG: I was thinking along the same lines and shouldn't be hard to do with a bit of jQuery I'd hope!
-
- Posted 3 months ago #
I disabled the cache when I added bbPress to the site I am running, but desperately miss it (speedwise).
This kind of solution would allow me to reinstate the cache and everything would fly along nicely again!
-
- Posted 2 months ago #
JC: Anything further on this? I'm running this on a production site and have just noticed caching issues with W3 and bbPress. I would love to leverage what you've already figured out before I hack through it!
-
- Posted 2 months ago #
@jjj
I didn't understand from your reply do you want to add hooks that'll purge cache made by caching plugins inside a core?
Problem with page cache and bbPress (outside relative times) is that when something new is posted, parent post type(s) isn't cleared (for example, when you post a reply, topic's and forum's pages aren't refreshed until cache expires).
-
- Posted 2 months ago #
I'm working on a simple plugin that effectively fires:
do_action( 'edit_post', $id );on any topic, forum, etc. when edited, created, trashed, spammed, split, etc to flush the topic and forum out of the cache.
I've almost got it working and am just getting trashing / untrashing to work then will put it up somewhere to let others work on it. While it'll work in my case where I've not got a bbPress aware theme it may need some tweaking / improvements for all cases.
-
- Posted 2 months ago #
In the meantime, I've gone for a) low cache time - 60 minutes, plenty enough to have good performance though, and b) disable cache for logged in users only. This seems to be a satisfactory solution to me.
I also found, under heavy load, that Super/Total cache didn't help a great deal, while Quick Cache had a massive impact. YMMV though of course.
-
- Posted 1 month ago #
@JohnConners: How's the plugin coming along?
A bit off topic:
@CiaranG, Why do you think was the difference between performance of Super Cache and Quick Cache? Did you try Cache Preloading option in Super Cache? -
- Posted 1 month ago #
@johnconners - Any updates on your plugin? Page caching would be a HUGE help for large BBpress sites like mine.
-
- Posted 1 month ago #
Been a bit swamped with work lately so I've not had a chance to finish it up yet (there are still a couple of use cases where certain pages aren't flushed from the cache). However my approach has been to try and hook into the fewest places possible and just do the 'edit_post' action on whatever topic / forum / page needs flushing.
My current work in progress, in case anyone else has more free time just now than I do, is here:
http://downloads.johnsadventures.com/bbpress-cache-support-01.php
Hopefully in the next week or two I'll have some time to finish it myself if nobody else does in the meantime. Also, any thoughts on a better implementation - let me know!
-
- Posted 1 month ago #
Bated breath, etc
-
- Posted 1 month ago #
Just wanted to check if it's currently a bug / feature or I'm missing something obvious! <a href="http://www.anytimefitnesslocations.net/
">http://www.anytimefitnesslocations.net/ -
- Posted 1 month ago #
Could WP Super Cache tags do the job?
http://wordpress.org/extend/plugins/wp-super-cache/faq/
How do I make certain parts of the page stay dynamic?
There are 2 ways of doing this. You can use Javascript to draw the part of the page you want to keep dynamic. That's what Google Adsense and many widgets from external sites do. Or you can use a WP Super Cache tag to do the job but you can't use mod_rewrite mode caching. You have to switch to PHP or legacy caching.
There are a few ways to do this, you can have functions that stay dynamic or you can include other files on every page load. To execute PHP code on every page load you can use either the "dynamic-cached-content", "mfunc", or "mclude" tags. The "dynamic-cached-content" tag is easier to use but the other tags can still be used. Make sure you duplicate the PHP code when using these tags. The first code is executed when the page is cached, while the second chunk of code is executed when the cached page is served to the next visitor. To execute WordPress functions you must define $wp_super_cache_late_init in your config file.
dynamic-cached-content example
This code will include the file adverts.php and will execute the functions "print_sidebar_ad()" and "do_more_stuff()". Make sure there's no space before or after the PHP tags.
<!--dynamic-cached-content--><?php include_once( ABSPATH . '/scripts/adverts.php' ); print_sidebar_ad(); do_more_stuff(); ?><!-- include_once( ABSPATH . '/scripts/adverts.php' ); print_sidebar_ad(); do_more_stuff(); --><!--/dynamic-cached-content-->mfunc example
To execute the function "function_name()":
<!--mfunc function_name( 'parameter', 'another_parameter' ) --> <?php function_name( 'parameter', 'another_parameter' ) ?> <!--/mfunc-->mclude example
To include another file:
<!--mclude file.php--> <?php include_once( ABSPATH . 'file.php' ); ?> <!--/mclude-->That will include file.php under the ABSPATH directory, which is the same as where your wp-config.php file is located.
Example:
<!--mfunc date( 'Y-m-d H:i:s' ) --> <?php date( 'Y-m-d H:i:s' ) ?> <!--/mfunc--> -
- Posted 4 weeks ago #
Commodities.However, the U.S. clothing is much higher than the clothing. They also have a full range of accessories, including handbags, wallets, watches, sunglasses, shawls, hats, hair pieces, belts and jewelry, as well as wholesale shoes, underwear and cosmetics
tag: Adidas Sunglasses
-
You must log in to post.