We help IT Professionals succeed at work.

Clear Cache of Drupal 7 with Custom Code

Yuri Boyz
Yuri Boyz asked
on
335 Views
Last Modified: 2018-04-10
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
Comment
Watch Question

MishaProgrammer
CERTIFIED EXPERT

Commented:
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.
Yuri BoyzSoftware Engineer

Author

Commented:
Yes I have already checked it. But let me test the PHP Code mentioned.
IS there any other update?
Programmer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Yuri BoyzSoftware Engineer

Author

Commented:
Ok let me check this.
Yuri BoyzSoftware Engineer

Author

Commented:
I have checked your last command but it cannot resolve the issue.
Yuri BoyzSoftware Engineer

Author

Commented:
thanks for this.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.