--- drupal-head.updated/includes/path.inc	2008-10-14 04:01:08.000000000 -0700
+++ drupal-head/includes/path.inc	2008-10-25 16:45:07.000000000 -0700
@@ -65,8 +65,15 @@
       if (isset($map[$path_language][$path])) {
         return $map[$path_language][$path];
       }
+      if (!isset($map[$path_language]) && $item = menu_get_item()) {
+        // Cache per the path the user is on (nothing to do with the path requested).
+        $map[$path_language] = cache_get('pathmap:' . $item['path'] . ':' . $path_language, 'cache');
+      }
       // Get the most fitting result falling back with alias without language
       $alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s' AND language IN('%s', '') ORDER BY language DESC", $path, $path_language));
+      if ($item) {
+        cache_collect('pathmap:' . $item['path'] . ':' . $path_language, $map[$path_language], 'cache', CACHE_PERMANENT);
+      }
       $map[$path_language][$path] = $alias;
       return $alias;
     }
