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.

AttachmentSize
whois.admin_.inc-cache-patch.txt 1003 bytes
whois.module-cache-patch.txt 1.64 KB

#2

Status:needs review» patch (to be ported)

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.

AttachmentSize
whois-D6-698850.patch.txt 4.91 KB
whois-HEAD-698850.patch.txt 4.44 KB

#4

Status:patch (to be ported)» needs review

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?

AttachmentSize
whois-698850-Add_caching_of_records.patch 5.95 KB

#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.

AttachmentSize
whois-698850-Add_caching_of_records-5.patch 6.04 KB

#6

Status:needs review» fixed

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

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here