Topic: Page Caching/Action Caching. What do do and where?
So I need to implement caching on a site.
So far I was working with page caching and saw that I ran into some pretty big problems. The page caching was originally going to be used for when a person is logged out but there was also a login bar at the top. The login bar is apparently also page cached which is very bad when authentication tokens become invalid which I just ran into a moment ago so I decided to check in with the pros first before deciding to completely throw out page caching and go with action caching.
Another problem I had was when a page was previously https and I went to a cached page from a link that needed to be http the https stayed in the URL causing a few problems. Is there a way to make a page cached page always have the correct protocol?
Basically, it looks like I will need to use action caching for the logged out pages but keep the header fully dynamic. So the header will be loaded, then the action that shows a certain static page should be action cached I guess. In the header, I'm also thinking of doing fragment caching on the navigation buttons since those are always the same no matter what. It's only the login button area that changes.
And there's a static footer on every page so I guess I should fragment cache that since it's not part of an action. I see no way it could be action cached.
I'm just starting with caching so I could use some tips and if the things I'm planning on doing are good ideas. i'm worried my caching might slow the site down rather than speed it up since I read that fragment caching is the slowest and I'm not sure if it'll provide any speed up at all if it's for little things like a navbar. The navbar itself does take some processing with ruby though when not cached.
I read a pretty useful article here although it's from 2007 so it may be dated:
Last edited by ill (2009-07-27 23:46:20)