# Help with caching

**URL:** <https://www.ruby-forum.com/t/help-with-caching/128739>\
**Category:** Rails\
**Created:** [February 11, 2008, 6:09am UTC](https://www.ruby-forum.com/t/help-with-caching/128739 "2008-02-11T06:09:48Z")\
**Posts on this page:** 1\
**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:** [February 11, 2008, 6:09am UTC](https://www.ruby-forum.com/t/help-with-caching/128739/1 "2008-02-11T06:09:48Z")

</div>

I’m using lighttpd serving mongrel backends. I have the following  
rewrites in my lighty conf file:  
url.rewrite += ( “^/$” =\> “/cache/index.html” )  
url.rewrite += ( “^([^.]+)$” =\> “/cache/$1.html” )

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.

What do I need to do to correct this?
