Skip to:
Content

Opened 4 years ago

Closed 4 years ago

#2800 closed defect (fixed)

Clean topic/reply post cache on certain actions

Reported by: thebrandonallen Owned by: johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version: trunk
Component: API - Cache Keywords: has-patch
Cc:

Description

When working with counts, our caching layer causes some counts to be out of sync. Included patch remedies this situation.

This patch goes along with the improved count tests I'm adding to another ticket. I'll link to it when I've created it.

Attachments (2)

2800.01.patch (1.9 KB) - added by thebrandonallen 4 years ago.
2800.02.patch (2.7 KB) - added by thebrandonallen 4 years ago.
Cache cleaning improvements

Download all attachments as: .zip

Change History (7)

#1 @johnjamesjacoby
4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r5733. See #2801.

This ticket was mentioned in Slack in #bbpress by thebrandonallen. View the logs.


4 years ago

#3 @thebrandonallen
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Attached patch does two things:

1) Condenses the majority of our bbp_clean_post_cache actions onto WP's clean_post_cache hook.

2) Reworks bbp_clean_post_cache() to function better with the post type agnostic clean_post_cache hook.

The result is that our current tests pass without having to manually call bbp_clean_post_cache(), and all of our factory create methods now have cache clearing built in. All of our existing tests continue to pass.

As our test base builds up, we should probably audit the other areas where we're calling bbp_clean_post_cache, either directly or via hook. We may be able to remove some of them.

@thebrandonallen
4 years ago

Cache cleaning improvements

#4 @johnjamesjacoby
4 years ago

This seems much more sane. Nice work.

#5 @johnjamesjacoby
4 years ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from reopened to closed

In 5774:

Cache: Much more sane cache invalidation.

This change improves hierarchical forum/topic/reply cache invalidations by not requiring each call to be strategically placed between actions to avoid race conditions.

Props thebrandonallen. Fixes #2800.

Note: See TracTickets for help on using tickets.