Use the cache object through an acesssor instead of an ivar.
Create the storage in a protected method so custom storage classes can be used.
Add some internal accessors to the middleware class.