# Bug in caches\_action?

**URL:** <https://discuss.rubyonrails.org/t/bug-in-caches-action/17642>\
**Category:** rubyonrails-talk\
**Created:** [August 31, 2007, 6:15pm UTC](https://discuss.rubyonrails.org/t/bug-in-caches-action/17642 "2007-08-31T18:15:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_E\_G\_Lynch](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Paul\_E\_G\_Lynch](https://discuss.rubyonrails.org/u/Paul_E_G_Lynch)\
**Post date:** [August 31, 2007, 6:15pm UTC](https://discuss.rubyonrails.org/t/bug-in-caches-action/17642/1 "2007-08-31T18:15:37Z")

</div>

Has anyone actually seen a before filter being called once an action is cached with caches\_action? When I try to use caches action, the before filter is called only if the action hasn't already been cached. In other words, caches\_action functions much like caches\_page. Here is some test code that shows the problem:

class TestCaseController \< ApplicationController &nbsp;&nbsp;caches\_action :show &nbsp;&nbsp;before\_filter :my\_filter

&nbsp;&nbsp;def my\_filter &nbsp;&nbsp;&nbsp;&nbsp;logger.info('%%% hi') &nbsp;&nbsp;end

&nbsp;&nbsp;def show &nbsp;&nbsp;&nbsp;&nbsp;render(:text=\>'hello from show') &nbsp;&nbsp;end

end

If you put this into your controllers directory, start your server in production mode, and go to [http://localhost:3000/test\_case/show](http://localhost:3000/test_case/show), then you will see the "hi" message in the log. However, if you hit reload, the "hi" message does not appear a second time. Am I doing something wrong?

Thanks, &nbsp;&nbsp;--Paul
