<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -332,11 +332,20 @@ module GeoKit
       # The failover approach is crucial for production-grade apps, but is rarely used.
       # 98% of your geocoding calls will be successful with the first call  
       def self.do_geocode(address)
+        res = CACHE.get(address.slugize)
+        unless res.nil?
+          RAILS_DEFAULT_LOGGER.info &quot;==&gt; Got #{address.slugize} from cache&quot;
+          return res 
+        end
         GeoKit::Geocoders::provider_order.each do |provider|
           begin
             klass = GeoKit::Geocoders.const_get &quot;#{provider.to_s.capitalize}Geocoder&quot;
             res = klass.send :geocode, address
-            return res if res.success
+            if res.success
+              CACHE.set(address.slugize, res)
+              RAILS_DEFAULT_LOGGER.info &quot;&lt;== Set #{address.slugize} from cache&quot;
+              return res
+            end
           rescue
             logger.error(&quot;Something has gone very wrong during geocoding, OR you have configured an invalid class name in GeoKit::Geocoders::provider_order. Address: #{address}. Provider: #{provider}&quot;)
           end</diff>
      <filename>lib/geo_kit/geocoders.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>79a0220f5a24cc54be5edd0943f2866267e1555c</id>
    </parent>
  </parents>
  <author>
    <name>Isaac Feliu</name>
    <email>isaac@vesne.com</email>
  </author>
  <url>http://github.com/isaacfeliu/geokit/commit/895305788cf08aa26c4d1336888b371921d51b22</url>
  <id>895305788cf08aa26c4d1336888b371921d51b22</id>
  <committed-date>2009-03-13T12:37:35-07:00</committed-date>
  <authored-date>2009-03-13T12:37:35-07:00</authored-date>
  <message>Added cache functionalities</message>
  <tree>9b95b0e897f19cb6aaa8b38a82c0f804513ce69d</tree>
  <committer>
    <name>Isaac Feliu</name>
    <email>isaac@vesne.com</email>
  </committer>
</commit>
