When path_set_alias is called without any arguments except the path i.e. path_set_alias('node/'. $node->nid); then it causes the path cache to be reset via drupal_clear_path_cache(). This occurs when the alias is being deleted from the url_alias table even when no records are actually removed.

This is a performance issue because drupal_clear_path_cache calls drupal_lookup_path() with an action of 'wipe', when used in conjunction with the pathcache module this results in an unnecessary cache clear of the cache_pathdst and cache_pathsrc cache tables. As an additional performance hit, when using a memcached caching backend this results in memcache_variable_set("cache_flush_$table", time()); being called, and the entire variables cache being rebuilt.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tsphethean’s picture

tsphethean’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1863834-1-path_alias_delete_cache.patch, failed testing.

tsphethean’s picture

Status: Needs work » Needs review
FileSize
500 bytes

Oops, lazy patch first time round. Proper patch this time.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.