#456824: drupal_lookup_path() speedup - cache system paths per page. introduced per page cached path aliases. However, there are two issues with the current implementation:
- AJAX autocomplete handlers create cache records containing only one entry (the AJAX handler's URL itself)
- invalid page requests create cache records.
These records may fill up the cache table with thousands of invalid entries, eventually taking up all available database space.
Therefore, the code should obey the following two conditions:
- Only write a cache record if the path alias map contains more than one entry, which rules out AJAX handlers. And caching just one path won't result in any performance gain anyway (one cache lookup vs. one direct lookup).
- Never cache the path alias map on error pages, i.e. anything with a HTTP 4xx code.
Also tagging with Pressflow, which contains a backport of this feature for D6.
Comments
Comment #1
catchSubscribing.
First point seems like a no brainer.
Second point there are all kinds of per path caches and processing that happens on 404 and 403 pages, for preventing caching the should be a standard pattern if we wanted to do that.
Comment #2
Akaoni commentedIt also seems that expired cache_path entries aren't cleaned up which compounds the problem.Edit: Not relevant to this issue.
Comment #3
Akaoni commentedQuick cache_path cleanup patch.Edit: Not relevant to this issue.
Comment #4
berenddeboer commentedThis looks like an important bug, and explains why my database are filling up!
Comment #5
Akaoni commented@berenddeboer: Which issue is an important bug?
I think I might have muddied the waters adding the fact that cache_path isn't cleaned up here.
My bad. :(
Worth splitting this into two issues?
Comment #6
dawehnerHere is a test patch for the patch above. This should probably fail.
Comment #7
dawehnerExpect this patch to fail.
Comment #9
Akaoni commentedMoved the cache_path not being cleaned up issue to it's own thread:
http://drupal.org/node/1259096
Sorry again for hijacking this one.
Moved this issue to 8.x-dev and tagged for backport.