[Zope-CMF] "statify" css

Dieter Maurer dieter at handshake.de
Sat Jan 22 13:32:03 EST 2005


robert wrote at 2005-1-22 14:19 +0100:
>I assume, that in a CMF/Plone setup css are not cachable since some of 
>their values are created at runtime.
>
>Is that assumption correct?

Primarily, they are not cachable because they lack the corresponding
"*.metadata" files.

You should examine each CSS file you indend to cache
to see whether it generated in a dynamical way that would
prevent correct caching (e.g. when it would try to adapt
to different browsers or current user previledges).

>I created a tool cssGrabber that writes all css files that are used in a 
>CMF/Plone site and writes them into a skin directoriy (in the FS) and 
>adds a .metadata file with cacheing information.
>EG for a standard plone site if creates files like the following:
> ploneColumns.css.dtml
> ploneColumns.css.dtml.metadata
>...
>
>agin, does that make sense??

As always with caches (either the own you implemented yourself
or a standard cache) you must be aware of cache inconsistencies.

When you change the configuration (such that e.g. "ploneColumns.css"
would get created differently) or the object even adapts
automatically to the context (to current browser, user), then
your cached version would become inconsistent.

>Or ar the css files cached by some other means?

A standard cache (e.g. Apache with "mod_cache" or Squid) would
give you more control (e.g. "max-age", "expires"; see HTTP 1.1 specification).

-- 
Dieter


More information about the Zope-CMF mailing list