The problem with having an environment-dependent serializer is that the cache needs access to it because it might change its behavior depending on environment parameters.
IIRC, the reason why serializers are "special" WRT cache stuff is exactly this (i.e. circular reasoning alarm sounding): they are not depending on the environment, and they act as blackboxes.
OTOH, the environment-dependent serializer will need to provide the right Validity for the cache and that's it. Am I wrong?
It looks to me that the issues are mostly potential abuse/Separation of Concerns, and I think they are obsolete by now:
* People could write pipelines of just generation -> specialSerializerForMyUncleBrowser, subverting the whole architecture (but they should not be using cocoon for this, there are simpler ways to shoot yourself in the foot) ;-)
* Also, overoptimization in the cache layer (you wanted to asume serializers are ergodic, to save the dual caching and avoid potential performance problems, since some serializers *are* expensive)
Stefano.
-- Santiago Gala High Sierra Technology, S.L. (http://hisitech.com) http://memojo.com?page=SantiagoGalaBlog