I want to cache the sidebar(which is a partial) which is unique to a
particular user. (like the right sidebar of basecamp ).
- Can fragment caching achieve this ? How can you clear the cache
when the session is cleared ? And what makes better sense ? Storing it
in DB/memory/file. For a full page cache
it makes better sense to use the filesystem since the webserver can
serve it without hitting the rails framework. But in this case since
it is a partial being cached rails need to read it from the filesystem
to produce the final HTML. So is the filesystem read overhead worth it
? (Correct me if i’m wrong.)
- You can just stick the html produced first time in a session object
(session[:sidebar] ) and then use it in the views. And then use a
better session store (SQLsessionstore/memcached).
To me the 2nd option looks much better. Any reason not to use session
for this ?