I have a section in my main layout like the following. I am starting to use memcached and wondering if this portion can be cached somehow becasue the current_user call makes a hit to the database for every page load and by nature of the plugin (authlogic) thats behind it, it actually updates the user record (i.e. the perishable token).
Is there anyway around this through caching or any other means?
<ul class="header_links">
<% unless current_user %>
<li><%= link_to "Sign Up", new_user_path, :id => 'main_sign_up_link', :class=> 'special-text'%></li>
<li><%= link_to "Login", login_path, :id => 'main_login_link' %></li>
<% else %>
<li><%= link_to "New Vote", new_user_vote_topic_path(current_user), :id => 'main_new_vote_link', :class=> 'special-text' %></li>
<li><%= link_to current_user.username.titleize, current_user, :id => 'main_profile_link' %></li>
<li><%= link_to "Logout", logout_path %></li>
<% end %>
</ul>