Removing cache after an action is run in activecollabe

I required to clear all cache including views and database routes context after i called an existing recurring profile action. Placing the following command near the end of the action/function helped me.

[text]cache_remove_by_pattern(‘recurring_profile*’);[/text]

It does perform a pattern match and clears all cached data which start with “recurring_profile”. For example, the following files are removed when this function is executed.

[text]cch_recurring_profile_routes.php
cch_recurring_profiles_routes.php[/text]

etc..

It would also delete all related cached data stored in database tables.

There is another function named cache_remove() which i haven’t tried but i guess runs similar to the one above. They call/run it something like:

[text]cache_remove(‘acx_project_objects_*’);[/text]

So, to say, you may clear all cache using:

[text]cache_remove(‘*’);[/text]

In fact, to just clear it all, there is cache_clear() which i guess does the trick to clear all cache. There is a $load_backend_if_missing argument passed to this function but i am not sure how it works.

I hope this helps someone.

Leave a Reply