Active Collab Logo

Removing cache after an action is run in activecollabe

Active Collab Logo

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.

cache_remove_by_pattern('recurring_profile*');

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.

cch_recurring_profile_routes.php
cch_recurring_profiles_routes.php

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:

cache_remove('acx_project_objects_*');

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

cache_remove('*');

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

Your email address will not be published. Required fields are marked *