RE: cache a object in modperl [EXT]

2020-09-16 Thread James Smith
6:49 To: mod_perl list Subject: Re: cache a object in modperl [EXT] Haha I can't answer that - I work with systems which are always up. We have users working across the globe so there is no non-active time. In my case I would have to throw an independent cache (my current choice is REDIS but

Re: cache a object in modperl

2020-09-14 Thread Patrick Mevzek
On Sun, Sep 13, 2020, at 21:51, Wesley Peng wrote: > For work requirement, I need to access IANA TLD database. > > So I wrote this perl module: > https://metacpan.org/pod/Net::IANA::TLD > > But, for each new() in the module, the database file will be downloaded > from IANA's website. > > I

Re: cache a object in modperl

2020-09-13 Thread Mithun Bhattacharya
Haha I can't answer that - I work with systems which are always up. We have users working across the globe so there is no non-active time. In my case I would have to throw an independent cache (my current choice is REDIS but you could chose a DB_File for all I know) and refresh it as needed -

Re: cache a object in modperl

2020-09-13 Thread Wesley Peng
Mithun Bhattacharya wrote: Does IANA have an easy way of determining whether there is an update since a certain date ? I was thinking it might make sense to just run a scheduled job to monitor for update and then restart your service or refresh your local cache depending upon how you solve

Re: cache a object in modperl

2020-09-13 Thread Mithun Bhattacharya
So how flexible are you with your service restart and how frequently do you wish to update your cache ? Does IANA have an easy way of determining whether there is an update since a certain date ? I was thinking it might make sense to just run a scheduled job to monitor for update and then restart

Re: cache a object in modperl

2020-09-13 Thread Wesley Peng
Hello Mithun Bhattacharya wrote: How frequently do you wish to refresh the cache ? if you do in startup then your cache refresh is tied to the service restart which might not be ideal or feasible. I saw recent days IANA has updated their database on date of: 2020.09.09 2020.09.13 So I

Re: cache a object in modperl

2020-09-13 Thread Mithun Bhattacharya
Startup is not a great idea if your webserver is up forever - I have some which are running for months. How frequently do you wish to refresh the cache ? if you do in startup then your cache refresh is tied to the service restart which might not be ideal or feasible. On Mon, Sep 14, 2020 at

Re: cache a object in modperl

2020-09-13 Thread Adam Prime
I left out the link to the thread. Here it is. https://marc.info/?t=11906287072=1=2 > On Sep 14, 2020, at 1:18 AM, Wesley Peng wrote: > > That's great. Thank you Adam. > > Adam Prime wrote: >> If the database doesn't change very often, and you don't mind only getting >> updates to

Re: cache a object in modperl

2020-09-13 Thread Wesley Peng
That's great. Thank you Adam. Adam Prime wrote: If the database doesn't change very often, and you don't mind only getting updates to your database when you restart apache, and you're using prefork mod_perl, then you could use a startup.pl to load your database before apache forks, and get a

Re: cache a object in modperl

2020-09-13 Thread Adam Prime
If the database doesn't change very often, and you don't mind only getting updates to your database when you restart apache, and you're using prefork mod_perl, then you could use a startup.pl to load your database before apache forks, and get a shared copy globally in all your apache children.

Re: cache a object in modperl

2020-09-13 Thread Mithun Bhattacharya
Your cache would have to be independent of mod_perl - I would suggest saving to a REDIS instance ? On Sun, Sep 13, 2020 at 9:51 PM Wesley Peng wrote: > Hello > > I am not so familiar with modperl. > > For work requirement, I need to access IANA TLD database. > > So I wrote this perl module: >

cache a object in modperl

2020-09-13 Thread Wesley Peng
Hello I am not so familiar with modperl. For work requirement, I need to access IANA TLD database. So I wrote this perl module: https://metacpan.org/pod/Net::IANA::TLD But, for each new() in the module, the database file will be downloaded from IANA's website. I know this is pretty