Post Content Prerendering
|Reported by:||markjaquith||Owned by:||markjaquith|
This is a first effort on building post content prerendering, as was discussed on wp-hackers.
The new hook is "the_content_filtered" and is stored in the already existing post_content_filtered column.
It involves a modification to the wp_insert_post() function that handles the prerendering on post publish/save. Several global variables are called in, so as to "recreate" the environment (the $post object and $id, namely.) This is because some "the_content" filters need to use these values and modify the post content accordingly.
For display, setup_postdata() has been modified. If the post_content_filtered column is blank and the post_content column is NOT, the post_content_filtered data will be filtered right then, and inserted into the database. This eliminates the need to do "rebuilding" as the "rebuilding" is done on the fly.
"the_content" filter will function as before. I have moved WP's default "the_content" filters to "the_content_filtered" and the idea is that when WP 1.6 comes out, we can educate plugin authors about the new hook, so they can make a decision for their plugin (most filters can be run ahead of time, but a few, like Google Hilight, need to be dynamic). The real speed boost will come when users have many plugins installed that use the new hook, especially on the front page, or category/month archives. Think textile2, acronym, multiple search/replace plugins, etc. I'd had this stuff max out PHP's memory when run on the front page! This is going to be much more efficient.
This is a first try, and I did this rather quickly, but it seems to work. Paging is working too, which is good.
Change History (18)
- Keywords bg|2nd-opinion bg|has-patch removed
- Milestone 2.2 deleted
- Resolution set to wontfix
- Status changed from new to closed
9 years ago
- Keywords bg|2nd-opinion bg|has-patch added
- Milestone set to 2.2
- Resolution wontfix deleted
- Status changed from closed to reopened
- Version changed from 1.6 to 2.1.2
- Milestone changed from 2.9 to 2.8
- Resolution set to invalid
- Status changed from reopened to closed