[Seaside] static image files
cdshaffer at acm.org
Sun Feb 26 17:16:26 UTC 2006
Brad Fuller wrote:
>I don't quite understand why one would have to restart the server to
>serve a static image file in a directory.
>Isn't there a default directory from which to place files that can be
>served? And if so, what is it? I only see Resource Base Url as a setting
>in config, but I don't know what that is.
Yes, you certainly don't have to restart your server just to get it to
serve files but I don't understand the rest of your question. Seaside
doesn't serve files, Kom (or Swazoo) does. The Resource Base URL
configuration stuff is Seaside-related and has nothing to do with Kom.
If you have a Kom server up and running you can simply add the
appropriate modules to it to configure it to serve files. I think you
will find this complicated at first but doable. My Squelenium project
has an installation script which scans a Kom stack and inserts new
modules into it as needed (it is on SqueakMap). It might make a good
example for you. The script I provide in my tutorial (which grew out of
one I copied from a Wiki) tries to start from a blank slate to avoid
problems associated with dealing with other people's configurations.
>I suppose it is better to create a dictionary of graphics if they are
>small so that locating the image is not a problem every time.
>How do others do it? What is the best way to serve graphics (be it small
Through an apache front end, ultimately. Serving large files from
Squeak is a bad idea on production systems...Squeak's file I/O blocks
the entire VM (not just the Squeak process doing the I/O). It works
fine for small apps and images though. Serving files from Kom is also
the probably best config for development since it reduces the potential
sources of problems.
More information about the Seaside