Page/Action/Fragment Caching
|
|
Hi Eldon (et al?), I was working through the Practical Rails Projects book and looking at the caching mechanisms… I like being able to serve 10,000 requests per second!!! (on my desktop no less)... But (you knew there had to be one coming), I implement sortable tables on my index views with something like this, where column headers are: link_to ‘Project Name’, scenarios_path(:order => ‘proj_name’) I’m trying to figure out a clean method of caching the index in its various forms. Since the sortable columns are all defined up front, I suppose I could create an action for each sorted view and cache them independently via action caching, and clear them all on a save or destroy, but that just feels wrong… kind of “just out of the shower wet” as opposed to “dry”. Any hints? Thanks, and great book btw. |
|
|
Thanks for the compliment. I guess the first question I would ask is if it would be possible to move that sortable table to something client side instead of server side? If not – my next guess would be to avoid doing page-caching and look into fragment caching so that other non-dynamic sections are cached while that list which can be affected by the user would be dynamic. Does that help? |