in reply to Where to save module data
I thought it would be a good idea to cache it to a text file and use that if it under a few hours old.
It certainly would be a good idea. However, if you'll permit me to chip in with the results of my experience, I caution against writing such a caching system yourself. I have done this more than once and have also inherited code where others have done this more than once. In every single case the caching system has drawbacks - one or two are serious, all are irritating.
In Perl we are fortunate indeed to have a very high-quality but generic and flexible cache module available to use in the shape of CHI and it would be hard to praise it too highly. Do try it out in your (apparently fairly simple) use case. You should find it easy to use and very efficient and hopefully that will encourage you to use it for other, more involved, cache scenarios.
Is there a standard way to handle this?
To quote AST: The nice thing about standards is that you have so many of them to choose from.
🦛
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Where to save module data
by Bod (Parson) on Oct 09, 2024 at 11:28 UTC | |
by ysth (Canon) on Oct 09, 2024 at 16:39 UTC | |
by Intrepid (Curate) on Oct 19, 2024 at 22:32 UTC |