Quote from: BobRay at Jan 28, 2012, 10:39 PMMark, I think it might be clearer if that documentation page had separate examples for refreshing just the resource cache, refreshing just the System Settings cache, and refreshing the cache for a particular resource. I assume that you wouldn't need to retrieve the contexts for the last two, but maybe that should be stated and it would be nice to see an explanation of why you wouldn't want to refresh the Manager context resource cache and whether it's OK to refresh any one part of the cache without refreshing the others.
System Settings changes affect everything. If you update a System Setting, there may be certain keys which do not affect anything else, but in most cases, they will affect every cacheable Context, Resource, and Element in the site where they are used.
For the Resource cache, you may have components using this partition to cache additional Resource specific data, that is intended to be removed when the partition is refresh()'d. And custom components may have their own custom cache partitions with dependencies on data in other cache partitions.
I guess my point is that the interdependencies in the cache are complex and defining what must be refreshed when certain changes are made can be be very difficult. Thus the default behavior is to clear all Contexts and Resources, etc. when you clear the site cache, or all affected Contexts and their Resources when editing a specific Resource. This complexity is not eased by the flexibility of the framework in this case either.
My preference for future is to allow custom cache refresh configurations to be defined and applied, so site owners/developers can have fine-grained control when desirable, without having to delve into code.