Opened 3 years ago
Closed 21 months ago
#8462 closed enhancement (fixed)
bp_core_clear_cache should be filterable
Reported by: | shawfactor | Owned by: | espellcaste |
---|---|---|---|
Milestone: | 12.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Performance | Keywords: | has-patch |
Cc: |
Description
Right now bp_core_clear_cache just calls prune_super_cache( $cache_path, true );
This has two major problems, namely
- it is complete overkill (especially on multisite) as this clears the entire wp super cache cache.
- This just relies on wp super cache, if the code stays it should be a general solution
There ae two solutions. Either remove the code entirely (probably the best one)
or
Change the code such you can filter the circumstances in which you want to delete the cache. And maybe change the caching mechanism through a filter.
Change History (12)
#2
@
3 years ago
- Component changed from Core to Performance
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Up Next
- Owner set to espellcaste
- Status changed from new to accepted
Let's discuss this further in the next milestone. The solution seems simple but I'd like to better understand the use case and the possible side effects of introducing a new hook.
#3
@
3 years ago
Ideally we should get rid of wp super cache support from buddypres entirely (it is plugin territory). But at a minimum the ability to selectively suppress the caching behaviour is needed as buddypres removes all wpsc caches every time something changes in buddypress.
This is complete overkill.
#5
@
2 years ago
- Milestone changed from 11.0.0 to Up Next
Hi, sorry this ticket is postponed once again. I haven't seen it soon enough π. I believe as BuddyPress is used to power βhttps://profiles.wordpress.org there might be a reason why this code is there.
#6
@
2 years ago
Guys
What Iβm requesting would have no conflicts
i just want the code wrapped by a filter so it could be turned off. The default would still be to run it.
This would have zero effect on current users of this code.
#7
@
2 years ago
@shawfactor I get it! I personally just want to have a better understanding of what's happening there before introducing this change. :)
#8
@
22 months ago
The function clears the entire βwp super cacheβ cache on any new activity. It makes sense to have filter a filter allowing this behaviour to be disabled programmatically
It is very simple and makes so I bit mystified on why there is a delay.
This ticket was mentioned in βPR #50 on βbuddypress/buddypress by βrenatonascalves.
21 months ago
#9
- Keywords has-patch added; needs-patch removed
- As titled.
Trac ticket: βhttps://buddypress.trac.wordpress.org/ticket/8462
#10
@
21 months ago
In the above pull request, I suggest making the bp_core_clear_cache
function "hookable". This will allow plugin and theme authors to perform cache purge actions relative to their site/setup without introducing much hassle to BuddyPress itself.
Hello can someone look at this? All that is needed is a simple filter to turn this function off. As the way it clears the cache can be very heavy handed.