File cache for large files in perl
I am looking for a cache library in Perl. But the ones I found so far like Cache::Cac开发者_高级运维he and CHI all seem to assume you want to read the file into a data structure in Perl. I am only interested to caching the files to disk without ever reading the file content into Perl.
The files I am dealing with are around 200 MB and will be downloaded from the net. I want a size limit of the cache and an expiry time for the cached files.
Any suggestions ?
Edit: As I did not find any ready library for this I have implemented it myself now. But if anyone can point to one anyway it would of course be interesting.
Solve the problem with one layer of indirection. Store references to files, not the files themselves, in the cache. How exactly a reference looks like depends on your use case.
Try the Cache::File module from CPAN
精彩评论