While evaluating the module for my website I found that the module does a lot of stuff outside of the may_cache clause in the menu hook. this code seems to be executed for eaach and every page view causing some overhead. You should check the current path and only execute the absolute minimum of code.
A particular effect of this is that the CSS file will get included for every page. The CSS also clashes with the civicspace theme, I am not sure whose fault that is (CS theme or acidfree).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | fix_hook_menu.patch | 3.95 KB | vhmauery |
Comments
Comment #1
vhmauery commentedA lot of the stuff used to be in acidfree_init until I learned that stuff in that function could not call certain functions and caused caching problems. I figured out that the !may_cache portion of hook_menu was the place to put initialization stuff that is not cacheable.
I have tried to keep stuff in the may cache section, but I ran into some dependency problems. Some of the menu stuff that I add depends on what is in the non-cacheable section...
The css file needs to be included on every page if there is an acidfree block on that page.
But, I have tried a new approach. In the non-cacheable section, I load some stuff and save it in the variable table. Then in the cacheable section, I load that back in from the variable table. See if you like this approach more.
Comment #2
vhmauery commentedNobody objected to my patch. This does have some major improvements for those who want to have drupal caching turned on. If you see any problems, please be sure to clear your drupal cache and browser cache before reporting any trouble.
The fix is in CVS and waiting to be repackaged.
Comment #3
vhmauery commented