# Caching action and parameters

**URL:** <https://www.ruby-forum.com/t/caching-action-and-parameters/152975>\
**Category:** Rails\
**Created:** [November 10, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/caching-action-and-parameters/152975 "2008-11-10T19:50:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bingbangboum](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ee7513/32.png) [@bingbangboum](https://www.ruby-forum.com/u/bingbangboum)\
**Post date:** [November 10, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/caching-action-and-parameters/152975/1 "2008-11-10T19:50:13Z")

</div>

Hello,

I have a controller called user with an index action wich list all  
users.  
I can specify the order in the url like this /index/ordering/name/  
increasing.  
I have a lot of user so i use a params[:page] to list them like this /  
index/2.  
All work find.  
Next i want to cache my index action so in my user controller i put :

Code : - fold - unfold

1. caches\_action :index

Troubles arrive.  
When i go to /index a user.cache file is created.  
When i go to /index/2 a new cache file is created.  
But when i go to /index/ordering/name/increasing ,none file is  
created , the server give me the user.cache file created before , and  
my users are not ordered.

Thanks.
