Skip to content

Commit

Permalink
+ updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
niko committed Jun 4, 2011
1 parent 4f8c57c commit ac07360
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.textile
Expand Up @@ -6,6 +6,17 @@ A proxy object around the geoip gem for lazy lookup. Includes a Rack middleware.
* Rack::MMGeoip pins a MMGeoipProxy to your environment and does the loopup lazy when you first access a geoip property.
* Rack::MMGeoip looks for the standard geoip headers and wraps their access, too. So if you're adding these header with mod_geoip in Apache or with http_geoip_module in NGinX these headers are used. So you can use this middleware even in production without compromising performance if NGinX or Apache already adds these headers.

h2. Usage

<pre><code>
geo = MMGeoip.new(:ip => '134.34.3.2')
geo.city # => "Konstanz"
geo.region # => "01"
geo.region_name # => "Baden-Wurttemberg"
geo.lat # => 47.66669999999999
geo.lng # => 9.183300000000003
</code></pre>

h2. Performance

Rack::MMGeoip uses the geoip gem. In my tests this lib did about 17_000 lookups in about 17 seconds on my MBP, so you probably lose one ms per request when using the middleware.
Expand Down

0 comments on commit ac07360

Please sign in to comment.