[Zope] semipersistent

Andreas Kostyrka andreas@mtg.co.at
Tue, 20 Jul 1999 15:23:54 +0200 (CEST)


On Tue, 6 Jul 1999, Robin Becker wrote:

> I'm using various external methods to create GIF files in my current
> server. These are expensive to produce, but are created on a per user
> basis eg as the results of a user input.
> 
> How can I make these temporary in the sense that they live until the
> connection is dropped.
Which connection? *wonder* HTTP is quite stateless, and opens connections
in a client depending order. And usually, when the page is done, NO
connections are open.

What you might want to do, is some kind of caching. One way would be to a
special Folderish object, let's call it NameGifFactory.
When it is traversed, it tries to use a cached version, or it generates a
Gif file. 

Now, for deciding how long to keep the objects, I'd consider abusing the
database cache: When the gif image object gets deactivated (written to
disc) would seem to be a good moment to delete the image.

Andreas
-- 
Win95: n., A huge annoying boot virus that causes random spontaneous system
     crashes, usually just before saving a massive project.  Easily cured by
     UNIX.  See also MS-DOS, IBM-DOS, DR-DOS, Win 3.x, Win98.