# Question about caching

**URL:** <https://www.ruby-forum.com/t/question-about-caching/127415>\
**Category:** Rails\
**Created:** [January 29, 2008, 12:53am UTC](https://www.ruby-forum.com/t/question-about-caching/127415 "2008-01-29T00:53:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eggman2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/51bf81/32.png) [@eggman2001](https://www.ruby-forum.com/u/eggman2001)\
**Post date:** [January 29, 2008, 12:53am UTC](https://www.ruby-forum.com/t/question-about-caching/127415/1 "2008-01-29T00:53:06Z")

</div>

I have in environment.rb:  
config.action\_controller.page\_cache\_directory = RAILS\_ROOT + “/public/  
cache”

The following rules in lighttpd.conf:  
url.rewrite += ( “^/$” =\> “/cache/index.html” )  
url.rewrite += ( “^([^.]+)$” =\> “/cache/$1.html” )

What I’m seeing is that if a page has already been cached (and exists  
in public/cache), it gets served properly. However, if the page hasn’t  
yet been cached, mongrel is looking for the cached page, can’t find it  
and throws a Routing Error.

I followed this article pretty closely:  
[http://www.railsenvy.com/2007/2/28/rails-caching-tutorial](http://www.railsenvy.com/2007/2/28/rails-caching-tutorial)

Any ideas?

---

<div class="post-metadata">

**Author:** ![eggman2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/51bf81/32.png) [@eggman2001](https://www.ruby-forum.com/u/eggman2001)\
**Post date:** [February 6, 2008, 12:25am UTC](https://www.ruby-forum.com/t/question-about-caching/127415/2 "2008-02-06T00:25:42Z")

</div>

Anyone?
