# Cache block skipped over

**URL:** <https://www.ruby-forum.com/t/cache-block-skipped-over/109903>\
**Category:** Rails\
**Created:** [July 20, 2007, 12:59am UTC](https://www.ruby-forum.com/t/cache-block-skipped-over/109903 "2007-07-20T00:59:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [July 20, 2007, 12:59am UTC](https://www.ruby-forum.com/t/cache-block-skipped-over/109903/1 "2007-07-20T00:59:15Z")

</div>

I’m running my local server in production mode and a fragment cache on  
the front page fails to render at all. I route the front page to the  
about controller:

map.index ‘’, :controller =\>  
“about”, :action =\> ‘front\_page’

And the action looks like:

def front\_page  
unless read\_fragment(:part =\> ‘time’)  
@time = Time.now  
end  
end

Finally, app/views/about/front\_page.rhtml has at the top:

before  
\<%- cache(:part =\> “time”) do -%\>  
in the fragment  
\<%= debug @time %\>  
\<%- end -%\>  
after

No cached fragment appears in tmp/cache/localhost:3000/ and when I  
load the page (yes, I remembered to stop and start the server) I see  
“before after” without “in the fragment” at all. I’m at a loss – the  
cache block is just silently failing to produce anything, and there’s  
nothing in the logs. I’ve got caches working on other actions, so I  
know it’s not all of caching that’s broken.

Any ideas what could be causing this?
