# Page cache is ignoring pagination params

**URL:** <https://www.ruby-forum.com/t/page-cache-is-ignoring-pagination-params/115681>\
**Category:** Rails\
**Created:** [September 27, 2007, 4:43pm UTC](https://www.ruby-forum.com/t/page-cache-is-ignoring-pagination-params/115681 "2007-09-27T16:43:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hitertan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@hitertan](https://www.ruby-forum.com/u/hitertan)\
**Post date:** [September 27, 2007, 4:43pm UTC](https://www.ruby-forum.com/t/page-cache-is-ignoring-pagination-params/115681/1 "2007-09-27T16:43:53Z")

</div>

My app’s homepage uses pagination. I would like to page cache  
each page of that pagination but i’m having difficulty getting  
rails to generate different files for each page, instead it tries  
to create index.html regardless of which page number i’m viewing.

##############################  
#routes.rb  
map.connect ‘’, :controller=\>‘questions’  
map.connect ‘questions/:page’, :controller=\>‘questions’  
##############################

##############################  
#QuestionsController.rb  
caches\_page :index  
def index

# paginate code that uses params[:page] if available

end  
##############################

If I access “/” with my browser, index.html gets created in the  
page cache directory. When I access “/questions/2”, the  
pagination works correctly, and rails tries to create a new cache  
file. But this new file is also called index.html while I had  
expected ‘questions/2.html’ to be created.

Is it clear to anyone what I’m doing wrong here? or how i can  
alter things to get the result i was expecting? thanks in  
advance!
