#41131 closed enhancement (fixed)
Add caching to get_adjacent_post
Reported by: | spacedmonkey | Owned by: | spacedmonkey |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Posts, Post Types | Keywords: | has-patch has-unit-tests dev-feedback needs-dev-note |
Focuses: | performance | Cc: |
Description
Add caching to the get_adjacent_post function. Current the caching in the function is not persistent.
Attachments (2)
Change History (24)
#4
@
7 years ago
In 26937#comment:57 @wpdavis has a valid point about caching. It seems like we have been down the road of trying to use WP_Query in this function. This patch adds caching to an expensive sql query. This ticket should progress ahead of #26937
This ticket was mentioned in PR #3366 on WordPress/wordpress-develop by spacedmonkey.
2 years ago
#9
Trac ticket: https://core.trac.wordpress.org/ticket/41131
This ticket was mentioned in PR #3734 on WordPress/wordpress-develop by @spacedmonkey.
21 months ago
#10
Trac ticket: https://core.trac.wordpress.org/ticket/41131
@spacedmonkey commented on PR #3366:
21 months ago
#11
Is it possible to use
WP_Query
if the filters become wrappers for their Query equivalents? It might require closures but has the advantage of using the low level cache rather than a duplicate cache.
I thought that using WP_Query
would be impossible. But I worked something out. https://github.com/WordPress/wordpress-develop/pull/3734.
This ticket was mentioned in PR #3743 on WordPress/wordpress-develop by @spacedmonkey.
21 months ago
#12
Trac ticket:
@spacedmonkey commented on PR #3734:
21 months ago
#13
Closing favour of #3366
@spacedmonkey commented on PR #3743:
21 months ago
#14
Closing in favour #3366
@spacedmonkey commented on PR #3366:
20 months ago
#15
@mukeshpanchal27 Update messages. Your approval, I will commit this change.
@spacedmonkey commented on PR #3366:
20 months ago
#17
#22
@
19 months ago
Drafted a note for this to be included in the Field Guide's notes section, as shared in https://wordpress.slack.com/archives/C02KGN5K076/p1677531978930639?thread_ts=1677512400.171959&cid=C02KGN5K076.
Patch added with tests. It is pretty simple patch.