Glossary clears filter cache way too often
| Project: | Glossary |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Marked critical for performance implications.
This is the code in question:
<?php
/**
* Implementation of hook_user().
*/
function glossary_taxonomy($op, $type, $array = NULL) {
if ($array) {
_glossary_clear_cache($array['vid']);
}
}
?>As far as I can tell from the hook_taxonomy() docs, $array is never NOT going to have stuff in it. In practice what this means is whenever a term or vocabulary is inserted, updated, or deleted, the entire contents of the cache_filter table go "bye-bye." This is especially problematic if you're using a bulk tagging module such as Calais because on node add, your page is positively filled with the "Filter cache has been cleared." messages.
It seems to me that the logic here should be something more like, "If something happened to a term or vocabulary *that directly affects the vocabularies I care about*, then call _glossary_clear_cache($array['vid']);".
