# Why do CacheSweepers listen to the Controller

**URL:** <https://www.ruby-forum.com/t/why-do-cachesweepers-listen-to-the-controller/171420>\
**Category:** Rails\
**Created:** [July 2, 2009, 4:58am UTC](https://www.ruby-forum.com/t/why-do-cachesweepers-listen-to-the-controller/171420 "2009-07-02T04:58:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmoniey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/6a8cbe/32.png) [@gmoniey](https://www.ruby-forum.com/u/gmoniey)\
**Post date:** [July 2, 2009, 4:58am UTC](https://www.ruby-forum.com/t/why-do-cachesweepers-listen-to-the-controller/171420/1 "2009-07-02T04:58:40Z")

</div>

I must be missing something, but it seems that it would be best to have  
the sweeper listen to ActiveRecord, and have it expire caches on  
after\_save & after\_destroy.

---

<div class="post-metadata">

**Author:** ![gmoniey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/6a8cbe/32.png) [@gmoniey](https://www.ruby-forum.com/u/gmoniey)\
**Post date:** [July 2, 2009, 1:19pm UTC](https://www.ruby-forum.com/t/why-do-cachesweepers-listen-to-the-controller/171420/2 "2009-07-02T13:19:34Z")

</div>

Agreed… I grew frustrated with CacheSweeper, and ended up migrating  
all the cache management to the models.
