----- Original Message ----- From: "Sascha Ottolski" <[EMAIL PROTECTED]>
To: <zope3-users@zope.org>
Sent: Saturday, January 13, 2007 8:02 AM
Subject: [Zope3-Users] best practice for serving static content by front-endwebserver?


Hi,

I guess lots of people already solved that, however, I couldn't find
something in the web yet.

I'm wondering how it is done best to let a front-end webserver server
the static content (image, css, js) on a live system, while keeping the
possibility to have a still working self-serving system (that is, I can
serve static files if I like, but don't have to).

Obviously I teach my frontend-server where to find the files by
rewriting urls.

Now, when grepping the zope sources, and third party packages, the
included files are spread around. that seems to make it impossible to
write proper rewrite rules. if a request wants

/++resource++/image.gif

the webserver couldn't possibly know if image.gif is found in

app/Zope-3.3.0/lib/python/zope/app/i18n/browser/

or in

app/Zope-3.3.0/lib/python/zope/app/rotterdam/

or in various other directories that carry images.

another problem are unpredictable urls that the zope3 core creates with
contructs like

<img tal:attributes="src context/++resource++zope3logo.gif" />

the src attribute could end up in many different URLs. In my opinion,
one would be better of just use src="/++resource++zope3logo.gif"; but I
suppose I'm might be missing something here.

Anyway, does anybody has a recipe for this? At the moment, I can only
think about symlinking all the files in to some dedicated directories,
but obviously that doesn't feel to be a good a solution (you will
forget to set the symlink for the new image you added, and I guess
name-clashes are possible, though I'm not sure about that one).

If you are using Apache in front of zope then Apache's caching may be of some assistance (you could look into Apache's mod_cache, mod_disk_cache and mod_mem_cache modules).


Jonathan
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to