Fix unused cache variable

Found this bug due to https://insight.sensiolabs.com/projects/119944e3-8364-4e13-86f9-c2b0ee9f5bfa/analyses/10?status=violations#180357944