[Seaside] Re: Template caching
Nevin Pratt
nevin@smalltalkpro.com
Thu, 25 Apr 2002 15:57:40 -0600
Avi Bryant wrote:
>
>No, that would be a huge pain to work with. Any time the #html method is
>changed (or any other, for that matter), the template cache for that class
>is automatically flushed. If you're using files, you should be using an
>IAFileTemplate, which checks the modification dates to do the same thing.
>
When you 'accept' a method change (or add a new method), the class
method #addSelector:withMethod: is called, which has been overridden in
IAPage to flush the cache. Fine.
But, if you *programmatically* change the #html, that doesn't happen,
because it doesn't involve an actual method change, and thus
#addSelector:withMethod: never gets called.
Now, the reason I don't used IAFileTemplate is because I don't want the
template built directly from the file, which is what IAFileTemplate
wants me to do. I instead want to read the html from the file, then
programmatically edit it (to handle a few html idiosyncracies
automatically), then build the template.
Some of the automatic editing are things that, as I said previously, I'm
not keen on propogating right now (I want to first learn the framework),
so I haven't talked about them (yet). I'm just experimenting right now.
But in any case, the point is, if your template html is programmatically
generated, the caches don't seem to get flushed. And I can see plenty
of uses for programmatically generating the html.
Plus, I still think that removing an application should also flush the
cache, and it does not appear to do so right now.
So, I still stand by my earlier suggestions.
But, like I say, I'm not *staunchly* standing by them. I need to learn
the frameworks better first.
Thanks,
Nevin