# Caching fragement

**URL:** <https://www.ruby-forum.com/t/caching-fragement/185848>\
**Category:** Rails\
**Created:** [March 27, 2010, 6:50am UTC](https://www.ruby-forum.com/t/caching-fragement/185848 "2010-03-27T06:50:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mailtorajuit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Post date:** [March 27, 2010, 6:50am UTC](https://www.ruby-forum.com/t/caching-fragement/185848/1 "2010-03-27T06:50:04Z")

</div>

HI all,

in my application i have index action. i called cache for this index by  
using

cache\_page :index  
and in index.erb page i called another partila page using and cached  
the fragment using

\<%cache “1” do%\>  
\<%@someobjects=Tablename.find(:all)%\>  
\<%=render(:partial=\>‘index2’,:collection=\>@someobjects%\>  
\<%end%\>

i want to expire the page and fragment caching how to do this.  
please its very urgent

Regards,  
Raju

---

<div class="post-metadata">

**Author:** ![mailtorajuit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Post date:** [March 27, 2010, 1:15pm UTC](https://www.ruby-forum.com/t/caching-fragement/185848/2 "2010-03-27T13:15:12Z")

</div>

Raju,

Check out

> **[ActionController::Caching](https://api.rubyonrails.org/classes/ActionController/Caching.html)**
>
> Caching is a cheap way of speeding up slow applications by keeping the result of calculations, renderings, and database calls around for subsequent requests.

[http://api.rubyonrails.org/classes/ActionController/Caching/Pages.html](http://api.rubyonrails.org/classes/ActionController/Caching/Pages.html)  
[http://api.rubyonrails.org/classes/ActionController/Caching/Fragments.html](http://api.rubyonrails.org/classes/ActionController/Caching/Fragments.html)

/Lasse

2010/3/27 Rajkumar S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
