[wp-trac] [WordPress Trac] #16692: Add hook to allow plugins to implement custom $wp->parse_request() logic to support arbitrary custom URLs
WordPress Trac
wp-trac at lists.automattic.com
Wed Jan 4 22:03:53 UTC 2012
#16692: Add hook to allow plugins to implement custom $wp->parse_request() logic to
support arbitrary custom URLs
------------------------------------+------------------------------
Reporter: mikeschinkel | Owner:
Type: enhancement | Status: reviewing
Priority: normal | Milestone: Awaiting Review
Component: Rewrite Rules | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------------------
Comment (by mikeschinkel):
I wanted to add a use-case for this ticket for the core developers to
consider, and that is that adding this hook would enable custom URL cache
functionality.
For example, if someone has a really complex site with lots of custom post
types, custom taxonomies and custom permastructs they could have upwards
of a 1000 rewrite rules to scan for every page load. Following the 80-20
rule, 20% of the URLs will be called 80% of the time so with this
`'wp_parse_request'` hook on a cron task a plugin could cache the most
recently used ~100 URLs into `wp_options` as an array where the keys would
be the URLs and the values would be the arrays that calling
`$wp->parse_request()` would ultimately set `$wp->query_args` to.
Clearly such a URL cache would not be compatible with the rare plugin that
has side effects in the hooks called within `$wp->parse_request()` but for
a site owner with a complex site and heavy traffic they could avoid or
modify those plugins and make a noticeable difference in performance.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16692#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list