Posted by Greg Go on January 29, 2010 at 10:40am
| Project: | Whois lookup |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Attached is a patch to add caching of whois lookups.
Adds a fieldset to the settings page that allows enabling/disabling caching and setting the length to time to cache results.
In whois_get_whois(), we check the cache for the record first, before doing a lookup.
Patched against 6.x-1.3
Comments
#1
attachments didn't take? attaching again.
#2
The code looks promising, and would probably also fix #151861: Enable logging and a Whois block showing previous lookups.
You should be able to update this to apply to the latest cvs with only minor adjustments.
#3
Added a setting for logging / not logging cached lookups.
Rerolled the patches against DRUPAL-6--1 and HEAD. I'm not sure I did this right... first time submitting. Also, the D7 version is untested since I don't have a D7 install ready to go.
I think I can tackle the other issue too by pulling from the watchdog table but one thing at a time.
#4
I adapted the patch a little bit.
* Only cache if no error occured
* include phpwhois lib for the Util class
* Include "(cached)" in the watchdog line when serving a cached result
* show the cache date
What do you think?
#5
It looks good!
The only problem I see was a comment I left in the settings -- "Log available as a block or a table at admin/reports/whois." I took that out since we haven't added that functionality in yet. Re-rolled.
#6
Thanks,
I just committed to DRUPAL-6--1 and HEAD.
Some thoughts for the future... maybe a refresh button or 'don't use cache' checkbox might come in handy for some people.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.