Avatar of Yuri Boyz
Yuri Boyz
Flag 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.


Avatar of undefined
Last Comment
Yuri Boyz

8/22/2022 - Mon

Do you read this article?


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

Yes I have already checked it. But let me test the PHP Code mentioned.
IS there any other update?

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Yuri Boyz

Ok let me check this.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Yuri Boyz

I have checked your last command but it cannot resolve the issue.
Yuri Boyz

thanks for this.