[drupal-devel] url aliases
Hi there! The pathauto module has recently become popular. It introduces path aliases for a lot of urls and exposes a performance issue with Drupal's handling of url_aliases. There are two things that need investigation: - wouldn't using conf_url_rewrite be cheaper in some of this cases? - why do we load all patch aliases for each and every page load? It is probably not the sql query SELECT * FROM {url_alias} that is the problem, but the processing in php afterwards (looping over the results). This happens in drupal_get_path_map(). Is there any reason why we couldn't only select the alias we need? Currently, we need all the aliases because we want to make sure they can be used when creating links on the generated page. Wouldn't it be possible to 1) during processing collect all the urls that are going to be on a page and 2) only retreive the needed aliases based on this info? Cheers, Gerhard
It is probably not the sql query SELECT * FROM {url_alias} that is the problem, but the processing in php afterwards (looping over the results).
this is such a common operation. It would be nice if there were some optimized function to turn a mysql result object into a php array. This happens in drupal_get_path_map(). Is there any reason why
we couldn't only select the alias we need? Currently, we need all the aliases because we want to make sure they can be used when creating links on the generated page.
Wouldn't it be possible to
1) during processing collect all the urls that are going to be on a page and 2) only retreive the needed aliases based on this info?
Cheers,
this would be possible if we left placeholders in the HTML and then replaced with aliased urls right before we print the page. In order to do so, we need some significant changes though: - modules always return output instead of printing theme('page') - add a 'replace url placeholders' step before calling the theme('page') - somehow replace placeholders for links emitted within the theme('page') like html_head, blocks, etc.
participants (2)
-
Gerhard Killesreiter -
Moshe Weitzman