title: Google Analytics API Authentication Speedup
body: <p>I'm using a Google Analytics API Class in PHP made by Doug Tan to retrieve Analytics data from a specific profile.</p>
  
  <p>Check the url here: <a href="http://code.google.com/intl/nl/apis/analytics/docs/gdata/gdataArticlesCode.html" rel="nofollow noreferrer">http://code.google.com/intl/nl/apis/analytics/docs/gdata/gdataArticlesCode.html</a></p>
  
  <p>When you create a new instance of the class you can add the profile id, your google account + password, a daterange and whatever dimensions and metrics you want to pick up from analytics.</p>
  
  <p>For example i want to see how many people visited my website from different country's in 2009. </p>
  
  <pre><code>//make a new instance from the class
  $ga = new GoogleAnalytics($email,$password);
  
  //website profile example id
  $ga-&gt;setProfile('ga:4329539');
  
  //date range
  $ga-&gt;setDateRange('2010-02-01','2010-03-08');
  
  //array to receive data from metrics and dimensions
  $array = $ga-&gt;getReport(
          array('dimensions'=&gt;('ga:country'),
          'metrics'=&gt;('ga:visits'),
          'sort'=&gt;'-ga:visits'
          )
  );
  </code></pre>
  
  <p>Now you know how this API class works, i'd like to adress my problem.</p>
  
  <p>Speed. It takes alot of time to retrieve multiple types of data from the analytics database, especially if you're building different arrays with different metrics/dimensions. How can i speed up this process? </p>
  
  <p>Is it possible to store all the possible data in a cache so i am able to retrieve the data without loading it over and over again?</p>