Ruediger Pluem <[email protected]> writes: > On 09/24/2009 04:25 PM, [email protected] wrote: >> + If there's some other cache provider that has to read the whole >> + cached body to fill in the brigade, though, that would make >> + this rather expensive. > > Exactly for this reason I don't like this approach. Currently we have only > mod_disk_cache but this might change in the future and the provider API is > open. So there might be third party modules affected by this. > > Why don't we just count the bytes as we store them? My first thought would be > to write a wrapper function for cache->provider->store_body() that could look > like the following and would be called instead of > cache->provider->store_body():
What I'd been thinking about, but haven't implemented yet, was extending the cache provider API (in trunk only) so we can ask the cache provider for the size. Your idea of a wrapper function sounds good for 2.2 though, since it doesn't require an API change. How about if I give that a try in trunk so we can see how it works before considering a backport? -- Dan Poirier <[email protected]>
