From: Robert Klemme Date: 2007-01-02T03:25:06+09:00 Subject: Re: Change Graph. (or "Tracking ERB Substitutions?") On 01.01.2007 18:20, Nate Murray wrote: > At work we are developing a rails system where the site is dynamic > for internal use but the pages on the live site are static. For > example, a user of our system edits Product data and they can see > their changes immediately in development. When the user publishes > their changes a static page html is generated and uploaded. Why are live pages static? Is this necessary? > It seems like this would work, however things get more complicated > when you factor in view/template changes. Lets say someone updates a > partial. How can we keep track of all pages that reference that > partial? Or say someone updates a template or reorganizes them, how > can you know if they changed? Do you actually *have* to update related pages? I mean, the id probably does not change and the title also - which would be the key bits you have on that page. Or do you actually include more information from the partial in other pages? In that case using IFRAMES might be a solution; then one page corresponds to exactly one item and you can easily detect whether you have to generate it anew or not. But that might make larger changes to your application necessary. > 2) Any ideas on a better way to approach this? If you follow the staged approach only to control when changes get visible you could do the export on DB level: you set up a second Rails installation with another DB and synchronize those databases once per day / week / whatever interval you need. This won't work of course if you do the staged approach with static pages for performance reasons. In that case (and yet it's a completely different approach) you could as well work with a reverse proxy. Yet another idea: you could probably collect change dates of all items presented in a view and set the corresponding HTTP header accordingly. That way clients should do a refresh only if the content had changed since last access time. I am not sure though how good this works in a Rails environment. So, this is a rather unstructured list. I guess my brain is not yet working properly this year. :-) Kind regards robert