Added sanitization and computation of file size to pre-caching script