Extract local cache middleware

Extract LocalCache Middleware, so it can requires rack dependencies,
without adding rack dependencies to `AS::Cache::Strategy::LocalCache`.
Merge pull request #14171 from arthurnn/extract_middleware_cache

Extract local cache middleware