Net::Google::SafeBrowsing2::Redis - Redis as back-end storage for the Google Safe Browsing v2 database.
The source code is available on github at https://github.com/juliensobrier/Net-Google-SafeBrowsing2-Redis.
use Net::Google::SafeBrowsing2::Redis; my $storage = Net::Google::SafeBrowsing2::Redis->new(host => '127.0.0.1', database => 1); ...
This is an implementation of Net::Google::SafeBrowsing2::Storage using Redis.
Create a Net::Google::SafeBrowsing2::Redis object
my $storage = Net::Google::SafeBrowsing2::Redis->new( host => '127.0.0.1', database => 0, );
Arguments
Optional. Redis host name. "127.0.01" by default
Optional. Redis database name to connect to. 0 by default.
Optional. Redis port number to connect to. 6379 by default.
Optional. Stay backward compatible with 0.3, but requires a bigger Redis database. 0 (disabled) by default
Optional. Keel all full hashes, even after they expire (45 minutes). 0 (disabled) by default
See Net::Google::SafeBrowsing2::Storage for the list of public functions.
Here are some numbers comparing the MySQL 0.6 back-end and Redis 0.4 back-end:
Database update, from empty to full update: MySQL: 1330s Redis: 351s
10,000 URLs lookup MySQL: 6s Redis: 5s
Storage: MySQL: 154MB Redis: 780MB
New options backward_compatible and keep_all.
Save 140MB in Redis (as of 08/01/2012)
Break backward compatibility with previous versions. Make sure you start from a fresh database (reset your existing database if needed).
Improve performances, fixes lookup. Requires 920MB for a full database (as of 07/31/2012)
See Net::Google::SafeBrowsing2 for handling Google Safe Browsing v2.
See Net::Google::SafeBrowsing2::Sqlite for a back-end using Sqlite.
Google Safe Browsing v2 API: http://code.google.com/apis/safebrowsing/developers_guide_v2.html
Julien Sobrier, <jsobrier@zscaler.com> or <julien@sobrier.net>
Copyright (C) 2012 by Julien Sobrier
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
2 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
=back without =over
To install Net::Google::SafeBrowsing2::Redis, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Google::SafeBrowsing2::Redis
CPAN shell
perl -MCPAN -e shell install Net::Google::SafeBrowsing2::Redis
For more information on module installation, please visit the detailed CPAN module installation guide.