views:

28

answers:

1

My home page is largely the same for all users, which makes it a candidate for page caching. however, there are a couple of things that are user specific. For example, there is a nav item that is only shown for logged in users and there is a link like logout, my profile etc, generated for specific users.

Do I have to use fragment caching instead? or should I use page caching and embed fragment caching for these specific items? or what other ways can this be accomplished.

Also, the nav bar is generated in a plugin (simple-nav), how do I control what is generated inside the plugin with regards to caching?

Thanks

+1  A: 

In this situation you are largely limited to fragment caching.

For a plugin you will probably have to have a look at the source in order to make a call about how caching can be handled. If the plugin generates the nav as some content that you push into a template, you can cache this fragment.

Depending on your audience, you might be able to push the non-cached elements to JS. You can cache the entire page and then use JS to flip the login/logout links. Really hardly worth the effort.

As with any performance optimisation,. Have you measured the performance of your system and collected metrics?

Toby Hede
thanks! just starting with perf tuning. what would tools/practices you recommend?
badnaam
lots of advice for that here on SO. New Relic's RPM is awesome. Rails also has a built-in profiler that is very useful.
Toby Hede