# Reset countercaches

**URL:** <https://discourse.cakephp.org/t/reset-countercaches/7805>\
**Category:** Uncategorized\
**Created:** [May 11, 2020, 4:52am UTC](https://discourse.cakephp.org/t/reset-countercaches/7805 "2020-05-11T04:52:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomasg](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@thomasg](https://discourse.cakephp.org/u/thomasg)\
**Post date:** [May 11, 2020, 4:52am UTC](https://discourse.cakephp.org/t/reset-countercaches/7805/1 "2020-05-11T04:52:04Z")

</div>

Hi,

I want to reset all the countercaches how to do it?  
This includes ones with custom finders and calculated fields.

Greets

---

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [May 11, 2020, 5:21am UTC](https://discourse.cakephp.org/t/reset-countercaches/7805/2 "2020-05-11T05:21:50Z")

</div>

Since you have to specify each counterCache and the details of how they operate, I assume you will also have to write the seek-and-destroy methods to reset them. And design the trigger conditions for when they run. There isn’t really any magic to them that I’m aware of.

Without any details of your situation, your goals, or what you have tried, no more detailed answer can be made.

---

<div class="post-metadata">

**Author:** ![thomasg](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@thomasg](https://discourse.cakephp.org/u/thomasg)\
**Post date:** [May 11, 2020, 5:44am UTC](https://discourse.cakephp.org/t/reset-countercaches/7805/3 "2020-05-11T05:44:02Z")

</div>

It would be easy to have a built in method in cakephp core that does this. I don’t want to have to write a custom piece of shell to reset every counter of every model. I think having a core function would be way eassier for everyone.
