Comment 18 for bug 100620

Revision history for this message
Andy Altepeter (aaltepet) wrote :

I have thought of an even better way to handle this, and fully from the SMI! First, I implemented a SilvaHTTPCacheManager, to change the behavior of the AcceleratedHTTPCacheManager so that authenticated requests to the public view are cached, except when the HTTP_REFERER is the SMI.

I think I'm going to try adding a blueprint for this, as it may be more ambitious than 2.1. My idea is as follows:

The silva-caching metadata set shouldn't map make associations with Cache Managers, where the cache policy is set through the ZMI. Instead, the silva-caching set should contain properties for the cache policy and there should be one http_cache_manager for _all_ silva objects.

It should be possible to have a cache policy for each base Silva interface:
ISilvaObject (e.g. a 'global' policy)
IContainer
IAsset
IContent
IVersionedContent

The cache policy for each interface is the number of seconds to cache (-1 disables caching).

Additionally, there will be a "Notify URLs (via PURGE)" property, to support purging intermediate (e.g. SQUID) caching proxies.

The custom Silva HTTP Cache Manager I wrote will be adjusted to look at the metadata settings for the appropriate interface.

There is still the problem that some types of content (especially versionedcontent, e.g. SilvaDocuments) shouldn't be cached at all. An example is a SilvaDocument with a dynamic code source. There is already an 'is_cacheable" method defined on ISilvaObject, but this method's symantics seem to indicate 'in-memory' caching. HTTP Caching is different, in that the cache isn't stored in memory on the server (to reduce rendering time), but the result is stored in a user-agent's cache or a caching proxy.

I propose a new method is_http_cacheable be added to ISilvaObject. This method could by default fallback to returning the value if is_cacheable. But, this isn't always what we want...SilvaDocuments with non-cacheable external sources perhaps should be cacheable in the browser...I think more thought will need to go into this part.

So, I'm going to add the above as a blueprint, and after I merge the Silva-File-Image-Caching-100620 back into the Trunk, I will mark this as 'fix released' (for Silva 2.1)