Link to home
Start Free TrialLog in
Avatar of Yuri Boyz
Yuri BoyzFlag for Uganda

asked on

Clear Cache of Drupal 7 with Custom Code

In my Drupal 7 Website, I have called an Ajax function by the click of a  button to do some Database modifications by different queries. Everything goes well but in the end I need to remove the cache also via code. My file is in /templates folder. I have tried various search functions of drupal to clear cache but nothing works.

Can any drupal 7 expert guide that how to clear the cache.

Note:  I am working on my custom functionality to Revert the Page contents to the last state. Everything goes well but when  I clear the cache then user will be able to see fresh content otherwise not. So I need to clear cache via my ajax code.

Looking forward for reply.

Thanks
Avatar of Misha
Misha
Flag of Russian Federation image

Do you read this article?

https://www.drupal.org/docs/7/administering-drupal-7-site/clearing-or-rebuilding-drupals-cache

There is some methods to remove cashe in other situation, if I correct understand your question.
Avatar of Yuri Boyz

ASKER

Yes I have already checked it. But let me test the PHP Code mentioned.
IS there any other update?
ASKER CERTIFIED SOLUTION
Avatar of Misha
Misha
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok let me check this.
I have checked your last command but it cannot resolve the issue.
thanks for this.