# Selective caching?

**URL:** <https://www.ruby-forum.com/t/selective-caching/88517>\
**Category:** Rails\
**Created:** [March 12, 2007, 8:41am UTC](https://www.ruby-forum.com/t/selective-caching/88517 "2007-03-12T08:41:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Johansson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@David\_Johansson](https://www.ruby-forum.com/u/David_Johansson)\
**Post date:** [March 12, 2007, 8:41am UTC](https://www.ruby-forum.com/t/selective-caching/88517/1 "2007-03-12T08:41:49Z")

</div>

I am thinking of not using a separate admin portal, but instead  
letting the admin of my application use the same interface as the end  
users see. The admin will then be able to see special “edit”, “delete”  
links next to blog posts, which users won’t see.

But as I understand it, that would mess up caching. If I for example  
cache the front page of my blog, users could end up being served the  
admin page instead, or the admin could get the cached standard page  
instead. Is there a way to switch off caching logic for a specific  
condition, like a user being the admin?

---

<div class="post-metadata">

**Author:** ![David\_Johansson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@David\_Johansson](https://www.ruby-forum.com/u/David_Johansson)\
**Post date:** [March 12, 2007, 9:04am UTC](https://www.ruby-forum.com/t/selective-caching/88517/2 "2007-03-12T09:04:50Z")

</div>

Sometimes just when you ask the question, you find the answer. If  
anyone has the same question as I, here are some potential answers

[http://blog.craz8.com/articles/2006/01/20/rails-action-cache-now-available-as-a-plugin](http://blog.craz8.com/articles/2006/01/20/rails-action-cache-now-available-as-a-plugin)  
[http://www.webdotdev.com/nvd/server-side/ruby/new-ruby-on-rails-plugin-cache\_filter.html+action\_cache+plugin&hl=sv&ct=clnk&cd=4&gl=se](http://www.webdotdev.com/nvd/server-side/ruby/new-ruby-on-rails-plugin-cache_filter.html+action_cache+plugin&hl=sv&ct=clnk&cd=4&gl=se)
