If an action_cached method throws an error, such as an
ActiveRecord::RecordNotFound exception, an empty entry is added to
the action cache that causes every subsequent request to return 200
instead of 404, 500, or whatever appropriate status code should be
there.

What's put in the cache after the first request

When did the change occur in Rails?

I've confirmed that Rails 2.1.2 and 2.2.2 don't exhibit this
behavior, but 2.3.2 does. (i.e. the older versions don't store an
empty response into the cache and they indeed throw a 404 for the
subsequent requests)

I'm having trouble testing against edge Rails, because loading
it causes the following error when starting the server:
foobar/vendor/rails/activesupport/lib/active_support/dependencies.rb:440:in
load_missing_constant': uninitialized constant
ActionController::Failsafe (NameError)

I've tested against the current head of the 2-3-stable branch,
375e8976e3, and it too exhibits this behavior.

I attempted to track down when the change occurred in the Rails
codebase to determine if it was intentional. It seems that
this seemingly innocuous commit, is where the bug starts.

Here are the details of the bisection, where 404 denotes the
desired behavior, 200 being undesired.

I'm having to run a patched version of Rails in production now,
because I rely heavily on action caching. Any chance this patch can
be reviewed for merging into Rails proper? Comments? I'll make any
changes requested.