# Rails incorrectly names cached files

**URL:** <https://www.ruby-forum.com/t/rails-incorrectly-names-cached-files/111864>\
**Category:** Rails\
**Created:** [August 12, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/rails-incorrectly-names-cached-files/111864 "2007-08-12T16:37:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![teesea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7feea3/32.png) [@teesea](https://www.ruby-forum.com/u/teesea)\
**Post date:** [August 12, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/rails-incorrectly-names-cached-files/111864/1 "2007-08-12T16:37:55Z")

</div>

I’m having difficultly getting simple page caching to work with named  
routes. I have a named route called “about” (url [About Us | Domain.com](http://www.domain.com/about))  
which goes to the controller called “home” and an action called  
“about”.

When activating page caching by adding this to the home controller

caches\_page :about

Rails creates the cached about page in “/home/about.html” instead of  
in “/about.html”. So every time a request comes in for the about page  
the web server cant find the cached page and directs the request to  
rails.

I’ve had a look around for anyone else having the same difficulties  
and cant find anything, which probably means I’m missing something  
very obvious but cant think what.

Any ideas?

Cheers

Teesea

---

<div class="post-metadata">

**Author:** ![teesea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7feea3/32.png) [@teesea](https://www.ruby-forum.com/u/teesea)\
**Post date:** [August 12, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/rails-incorrectly-names-cached-files/111864/2 "2007-08-12T18:01:02Z")

</div>

Thanks to a chap I was chatting to in irc I’ve found what the problem  
was

I had the default route before the named route so rails was taking  
this first and creating the cached files in [domain.com/home/about](http://domain.com/home/about)  
rather than in [About Us - Domain.com](http://domain.com/about.html)
