Skip to content

perf: prime curriculum item post caches before rendering - #641

Open
arshidkv12 wants to merge 1 commit into
LearnPress:developfrom
arshidkv12:sinle-cource-perfomance
Open

perf: prime curriculum item post caches before rendering#641
arshidkv12 wants to merge 1 commit into
LearnPress:developfrom
arshidkv12:sinle-cource-perfomance

Conversation

@arshidkv12

Copy link
Copy Markdown
Contributor
Screenshot 2026-09-07 at 3 06 13 PM

perf: prime curriculum item post caches before rendering

Avoid repeated post lookups while rendering course curriculum items by
priming the WordPress post cache for all curriculum item IDs before the
section items are rendered.

Collect the post IDs from all curriculum sections and call
_prime_post_caches() once with the complete list. This allows WordPress
to load the required post objects into the object cache in advance,
reducing repeated get_post() database queries during curriculum
rendering.

The cache is primed only when curriculum item IDs are available, avoiding
an unnecessary cache operation for empty sections.

This improves the performance of single-course curriculum rendering,
particularly for courses containing a large number of lessons, quizzes,
and other curriculum items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant