[Seaside] [Borges] Squeak Chess

Avi Bryant seaside@lists.squeakfoundation.org
Mon, 7 Oct 2002 12:59:42 -0700 (PDT)


On 7 Oct 2002, Cees de Groot wrote:

> Avi Bryant <avi@beta4.com> said:
> >>     callback := [ WASession currentSession respondWithDocument:
> >>         aForm asWebImage ].
> >
> >Hmm.  I should probably improve that interface anyway, it's silly to
> >hardcode it to either GIF or JPG.  But really, these images should be
> >served statically, so the browser can cache them.  Borges doesn't have an
> >interface for that at all, ideas?
> >
> Implement #asCacheableWebImage, and let it spit out a default cache policy of
> 24h; implement #asCacheableWebImageFor: so the sender can specify a number of
> seconds the image is valid. The rest is a matter of reading the RFC's and
> writing the correct 'Expires:' etcetera HTTP headers...

Well, what would that return?  I can see having
Session>>respondWithCacheableDocument: and
Session>>respondWithCacheableDocument:seconds:, however.  But that's only
half the problem - caching also requires a constant URL, which the current
methods don't provide.  How do you provide a constant URL for a Form?
The session could keep a cache of the continuation ids assigned to static
documents, although even then you have to make sure to use the same
MIMEDocument instance each time.  So then the interface would become
Session>>urlForDocument: .  I wonder is that also sufficient for images,
css files, etc, taken from disk?

Ramble mode off.

Avi