drupal_flush_all_caches();
in the module file seems very heavy. Typically it should be enough to clear the affected pages. A total cache clear is expensive on large pages.
Active
2.0
Code