While writing the new caching code, I spotted that the old one is really very imperformant and not so clever as it could be :(
The new caching algorithm will use less hashtables and maps and less object creations. In addition, if only a part of a response is cached, but more can be cached during this processing, the cached part is used to drive the new response (and this is then cached). Sounds a little bit complicated, so here is an example:
Requested: G(c) -> T1(c) -> T2(c) -> T3(c) -> S(c)
The pipeline above is completly cacheable (indicated by the c), but the cache contains only this:
Cached: G(c) -> T1(c)
Now, the old caching algorithm does not use the cached result, so the complete pipeline is processed. The new caching algorithm will use the cached response, feed it into T2 and then cache the complete pipeline.
Ok, perhaps there are only rare cases where this is needed, but I think it's cool anyway.
10:44:21 AM
|