Interesting problem. You could cache each record (the whole  
ActiveRecord object and call .to_json or even cache the JSON strings)  
and write a bit of JS to display the data in the table. I think in  
general, caching raw data is going to be the most flexible solution.

On Jul 30, 2009, at 4:37 PM, Guyren G Howe wrote:

>
> A technical challenge: I'm doing a comparison features, such as you
> often see on websites that let you compare phones or whatever: you
> choose one or more things to compare, and up comes a table with each
> thing represented by a column. So I have static columns, but I need to
> be able to mix them up arbitrarily.
>
> The interesting challenge here is how to cache (eg with memcached) so
> it works fast. Traditional fragment caching won't help: the fragments
> are threaded in with each other in the same table. There are likely to
> be common combinations for which I can cache the table or the entire
> page, but the combinatorics prevent this from being a general  
> solution.
>
> I could cache the data for the cells and just assemble the page each
> time. That would be the simplest solution, I think.
>
> Or I could cache the columns as separate tables and reassemble them
> into one table in Javascript.
>
> Or I could send them as separate tables and have a javascript adjust
> all the rows to be the same size.
>
> Anyone have any better ideas?
>
> Regards,
>
> Guyren G Howe
> Relevant Logic LLC
>
> guyren-at-relevantlogic.com ~ http://relevantlogic.com ~ +1 512 784  
> 3178
>
> Ruby/Rails, PHP, REALbasic programming
> PostgreSQL, MySQL database design and consulting
> Technical writing and training
>
> Read my book, Real OOP with REALbasic: 
> <http://relevantlogic.com/oop-book/about-the-oop-book.php
>>
>
> >



---------------------------------------------------------------

Jordan A. Fowler
E-mail: [email protected]
Website: http://www.jordanfowler.com
Phone: (619) 339-6752


--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to