app: fix memleak in cache

this patch fixes the following issue with export script in openshift:

  .openshift/cron/daily/export: line 3: 179664 Killed php -e export.php > /dev/null
  adding: export.xml (deflated 94%)
  Warning: daily cron run terminated as it exceeded max run time

Signed-off-by: Petr Oros <poros@redhat.com>