Caching Application Data (WordPress & Beer)

Monday, October 13th, 2014

Storing your application data in WP is really convenient, but querying it all can take a lot of overhead. There are many ways to cache data, but my preference is to create a “hard cache” – this means that the data is simply written to a file each time something is changed. Luckily WordPress makes this really easy:

Start by hooking your function to the save of your custom post type:

[php]
// add_action( ‘save_post_{post-type}’, ‘agb_update_data’ );
add_action( ‘save_post_agb_grain’, ‘agb_update_data’ );
add_action( ‘save_post_agb_hops’, ‘agb_update_data’ );
add_action( ‘save_post_agb_yeast’, ‘agb_update_data’ );
add_action( ‘save_post_agb_water’, ‘agb_update_data’ );
[/php]

Inside that function, make sure to ignore auto saves:

[php]
// Create static cache
function agb_update_data( $post_id ) {
    global $post,$wpdb;
    
    // If post is an autosave/autodraft, return
    if ( wp_is_post_autosave($post_id) || get_post_status($post_id) == ‘auto-draft’ ) {
        return;
    }
[/php]

Then, start recording the data. I like to add the datetime to the top to see how fresh everything is:

[php]
    ob_start();  //start recording the output
    echo "/* Data last updated: $date due to save/update/delete of post: $post_id */\n";
[/php]

Now, just query and format the data. In this case, we are just echoing everything as a series of JS arrays.

[php]
    /* ————————————–
     * Build hops data
     * ————————————– */
      $hop_string = ”;
      query_posts(array(‘post_type’=>’agb_hops’,’showposts’=>9999,’post_status’ => ‘publish’,’orderby’=>’title’,’order’=>’ASC’ )); /* grab all published hops */
      while (have_posts()) : the_post();
          $id = $post->ID;
          $title = get_the_title();
          $alpha_high = get_post_meta($id, ‘agb_hops_alphahigh’, true);
          $alpha_low = get_post_meta($id, ‘agb_hops_alphalow’, true);
          $alpha = ($alpha_high+$alpha_low)/2;
          if($title=="Generic"){ // put generic first
            $hop_string = "[$id,\"$title\",$alpha],".$hop_string;
          }
          else{
            $hop_string .= "[$id,\"$title\",$alpha],";
          }
      endwhile;
      // remove last comma (and \n) and print
      echo "var agb_hops = [ ".substr($hop_string,0,-1)."];\n";
[/php]

Finally, end the recording and write the file. Here I wrote it next to the other JS. However, a cache folder outside of the template folder might be safer.

[php]
// stop recording
     $data = ob_get_contents();
     ob_end_clean();
    
    // write
    file_put_contents($cache_file, $data);
}
[/php]

From the browsers’s perspective, the data is a static file:

[js]/* Data last updated: 2014-10-13 15:37:41 due to save/update/delete of post: 230 */
var agb_styles = [ ["Light Lager","1A","Lite American Lager",1.040,1.030,1.008,0.998,4.2,3.2,12.0,8.0,3.0,2.0],["Light Lager","1B","Standard American Lager",1.050,1.040,1.010,1.004,5.1,4.2,15.0,8.0,4.0,2.0],["Light Lager","1C","Premium American Lager",1.056,1.046,1.012,1.008,6.0,4.7,25.0,15.0,6.0,2.0],["Light Lager","1D","Munich Helles",1.051,1.045,1.012,1.008,5.4,4.7,22.0,16.0,5.0,3.0],["Light Lager","1E","Dortmunder Export",1.056,1.048,1.015,1.010,6.0,4.8,30.0,23.0,6.0,4.0],["American Ale","10A","American Pale Ale",1.060,1.045,1.015,1.010,6.0,4.5,50.0,30.0,14.0,5.0],["American Ale","10B","American Amber Ale",1.060,1.045,1.015,1.010,6.0,4.5,45.0,25.0,17.0,10.0],["American Ale","10C","American Brown Ale",1.060,1.045,1.016,1.010,6.2,4.3,45.0,20.0,35.0,18.0],["English Brown Ale","11A","Mild",1.038,1.030,1.013,1.008,4.5,2.8,25.0,10.0,25.0,12.0],["English Brown Ale","11B","Southern English Brown Ale",1.042,1.035,1.014,1.011,4.2,2.8,20.0,12.0,35.0,19.0],["English Brown Ale","11C","Northern English Brown Ale",1.052,1.040,1.013,1.008,5.4,4.2,30.0,20.0,22.0,12.0],["Porter","12A","Brown Porter",1.052,1.040,1.014,1.008,5.4,4.0,35.0,18.0,30.0,20.0],["Porter","12B","Robust Porter",1.065,1.048,1.016,1.012,6.0,4.8,55.0,25.0,40.0,22.0],["Porter","12C","Baltic Porter",1.090,1.060,1.024,1.016,9.5,5.5,40.0,20.0,30.0,17.0],["Stout","13A","Dry Stout",1.050,1.036,1.011,1.007,5.0,4.0,45.0,30.0,45.0,25.0],["Stout","13B","Sweet Stout",1.056,1.042,1.023,1.010,6.0,4.0,40.0,25.0,45.0,30.0],["Stout","13C","Oatmeal Stout",1.065,1.048,1.018,1.010,5.9,4.2,45.0,25.0,45.0,22.0],["Stout","13D","Foreign Extra Stout",1.075,1.056,1.018,1.010,8.0,5.5,70.0,30.0,45.0,30.0],["Stout","13E","American Stout",1.075,1.050,1.022,1.010,7.0,5.0,75.0,35.0,45.0,30.0],["Stout","13F","Russian Imperial Stout",1.100,1.075,1.034,1.018,13.0,8.0,95.0,50.0,45.0,30.0],["India Pale Ale (IPA)","14A","English IPA",1.075,1.050,1.018,1.010,7.5,5.0,60.0,40.0,14.0,8.0],["India Pale Ale (IPA)","14B","American IPA",1.075,1.056,1.018,1.010,7.5,5.5,65.0,40.0,15.0,6.0],["India Pale Ale (IPA)","14C","Imperial IPA",1.095,1.075,1.020,1.012,10.0,7.5,110.0,60.0,15.0,8.0],["German Wheat and Rye Beer","15A","Weizen/Weissbier",1.052,1.044,1.014,1.010,5.6,4.3,15.0,8.0,8.0,2.0],["German Wheat and Rye Beer","15B","Dunkelweizen",1.056,1.044,1.014,1.010,5.6,4.3,18.0,10.0,23.0,14.0],["German Wheat and Rye Beer","15C","Weizenbock",1.085,1.064,1.022,1.015,8.5,6.5,30.0,15.0,25.0,12.0],["German Wheat and Rye Beer","15D","Roggenbier (German Rye Beer)",1.056,1.046,1.014,1.010,6.0,4.5,20.0,10.0,19.0,14.0],["Belgian and French Ale","16A","Witbier",1.052,1.044,1.012,1.008,5.5,4.5,20.0,10.0,4.0,2.0],["Belgian and French Ale","16B","Belgian Pale Ale",1.054,1.048,1.014,1.010,5.5,4.8,30.0,20.0,14.0,8.0],["Belgian and French Ale","16C","Saison",1.080,1.048,1.016,1.010,8.5,5.0,45.0,25.0,12.0,5.0],["Belgian and French Ale","16D","Biere de Garde",1.080,1.060,1.018,1.012,8.0,6.0,30.0,20.0,19.0,6.0],["Belgian and French Ale","16E","Belgian Specialty Ale",1.080,1.030,1.019,1.006,9.0,3.0,40.0,15.0,50.0,3.0],["Sour Ale","17A","Berliner Weiss",1.032,1.028,1.006,1.004,3.6,2.8,8.0,3.0,3.0,2.0],["Sour Ale","17B","Flanders Red Ale",1.054,1.046,1.016,1.008,5.5,5.0,25.0,15.0,16.0,10.0],["Sour Ale","17C","Flanders Brown Ale/Oud Bruin",1.077,1.043,1.016,1.012,8.0,4.0,25.0,15.0,20.0,15.0],["Sour Ale","17D","Straight (Unblended) Lambic",1.054,1.040,1.010,0.000,6.5,5.0,10.0,0.0,7.0,3.0],["Sour Ale","17E","Gueuze",1.060,1.040,1.006,0.000,8.0,5.0,10.0,0.0,7.0,3.0],["Sour Ale","17F","Fruit Lambic",1.060,1.040,1.010,0.000,7.0,5.0,10.0,0.0,7.0,3.0],["Belgian Strong Ale","18A","Belgian Blond Ale",1.075,1.062,1.016,1.008,7.5,6.0,30.0,20.0,6.0,4.0],["Belgian Strong Ale","18B","Belgian Dubbel",1.075,1.062,1.018,1.010,7.5,6.0,25.0,15.0,14.0,10.0],["Belgian Strong Ale","18C","Belgian Tripel",1.085,1.075,1.016,1.010,9.0,7.5,38.0,25.0,6.0,4.5],["Belgian Strong Ale","18D","Belgian Golden Strong Ale",1.095,1.070,1.016,1.010,10.0,7.5,35.0,25.0,6.0,4.0],["Belgian Strong Ale","18E","Belgian Dark Strong Ale",1.115,1.075,1.024,1.010,13.0,8.0,30.0,15.0,20.0,15.0],["Strong Ale","19A","Old Ale",1.100,1.060,1.025,1.015,10.0,6.0,65.0,30.0,25.0,10.0],["Strong Ale","19B","English Barleywine",1.125,1.080,1.035,1.018,13.0,8.0,70.0,35.0,22.0,10.0],["Strong Ale","19C","American Barleywine",1.125,1.080,1.035,1.020,13.0,8.0,100.0,50.0,22.0,10.0],["Pilsner","2A","German Pilsner (Pils)",1.050,1.044,1.013,1.008,5.2,4.4,45.0,25.0,5.0,2.0],["Pilsner","2B","Bohemian Pilsner",1.056,1.044,1.017,1.013,5.4,4.2,45.0,35.0,6.0,3.5],["Pilsner","2C","Classic American Pilsner",1.060,1.044,1.015,1.010,6.0,4.5,40.0,25.0,6.0,3.0],["Fruit Beer","20A","Fruit Beer",1.110,1.030,1.024,1.004,12.0,2.5,70.0,5.0,50.0,3.0],["Spice/Herb/Vegetable Beer","21A","Spice, Herb, or Vegetable Beer",1.110,1.030,1.025,1.005,12.0,2.5,70.0,0.0,50.0,5.0],["Spice/Herb/Vegetable Beer","21B","Christmas/Winter Specialty Spice Beer",1.110,1.030,1.025,1.005,12.0,2.5,70.0,0.0,50.0,5.0],["Smoke-Flavored and Wood-Aged Beer","22A","Classic Rauchbier",1.056,1.050,1.016,1.012,6.0,4.8,30.0,20.0,22.0,14.0],["Smoke-Flavored and Wood-Aged Beer","22B","Other Smoked Beer",1.110,1.030,1.024,1.006,12.0,2.5,70.0,5.0,50.0,5.0],["Smoke-Flavored and Wood-Aged Beer","22C","Wood Aged Beer",1.110,1.030,1.024,1.006,12.0,2.5,70.0,5.0,50.0,5.0],["Specialty Beer","23A","Specialty Beer",1.110,1.030,1.024,1.006,12.0,2.5,70.0,5.0,50.0,5.0],["Traditional Mead","24A","Dry Mead",1.130,1.070,1.009,0.995,15.0,7.5,0.0,0.0,16.0,1.0],["Traditional Mead","24B","Semi-Sweet Mead",1.130,1.070,1.019,1.010,15.0,7.5,0.0,0.0,16.0,1.0],["Traditional Mead","24C","Sweet Mead",1.130,1.070,1.050,1.020,15.0,7.5,0.0,0.0,16.0,1.0],["Melomel (Fruit Mead)","25A","Cyser (Apple Melomel)",1.120,1.080,1.050,0.990,14.0,7.5,0.0,0.0,16.0,1.0],["Melomel (Fruit Mead)","25B","Pyment (Grape Melomel)",1.120,1.080,1.050,0.990,14.0,7.5,0.0,0.0,16.0,1.0],["Melomel (Fruit Mead)","25C","Other Fruit Melomel",1.120,1.080,1.050,0.990,14.0,7.5,0.0,0.0,16.0,1.0],["Other Mead","26A","Metheglin",1.130,1.070,1.025,0.995,15.0,7.5,0.0,0.0,16.0,1.0],["Other Mead","26B","Braggot",1.130,1.060,1.025,1.004,14.0,6.5,50.0,0.0,16.0,3.0],["Other Mead","26C","Open Category Mead",1.130,1.070,1.025,0.995,15.0,7.5,50.0,0.0,16.0,1.0],["Standard Cider and Perry","27A","Common Cider",1.060,1.045,1.020,1.000,8.0,5.0,0.0,0.0,10.0,1.0],["Standard Cider and Perry","27B","English Cider",1.070,1.050,1.010,0.995,9.0,6.0,0.0,0.0,10.0,1.0],["Standard Cider and Perry","27C","French Cider",1.065,1.050,1.020,1.010,6.0,3.0,0.0,0.0,10.0,1.0],["Standard Cider and Perry","27D","Common Perry",1.060,1.050,1.020,1.000,7.0,5.0,0.0,0.0,6.0,0.0],["Standard Cider and Perry","27E","Traditional Perry",1.070,1.050,1.020,1.000,9.0,5.0,0.0,0.0,6.0,0.0],["Specialty Cider and Perry","28A","New England Cider",1.100,1.060,1.010,0.995,13.0,7.0,0.0,0.0,10.0,1.0],["Specialty Cider and Perry","28B","Fruit Cider",1.070,1.045,1.010,0.995,9.0,5.0,0.0,0.0,10.0,1.0],["Specialty Cider and Perry","28C","Applewine",1.100,1.070,1.010,0.995,12.0,9.0,0.0,0.0,10.0,1.0],["Specialty Cider and Perry","28D","Other Specialty Cider/Perry",1.100,1.045,1.020,0.995,12.0,5.0,0.0,0.0,10.0,1.0],["European Amber Lager","3A","Vienna Lager",1.052,1.046,1.014,1.010,5.7,4.5,30.0,18.0,16.0,10.0],["European Amber Lager","3B","Oktoberfest/Marzen",1.056,1.050,1.016,1.012,5.7,4.8,28.0,20.0,14.0,7.0],["Dark Lager","4A","Dark American Lager",1.056,1.044,1.012,1.008,6.0,4.2,20.0,8.0,22.0,14.0],["Dark Lager","4B","Munich Dunkel",1.056,1.048,1.016,1.010,5.6,4.5,28.0,18.0,28.0,14.0],["Dark Lager","4C","Schwarzbier (Black Beer)",1.052,1.046,1.016,1.010,5.4,4.4,32.0,22.0,45.0,17.0],["Bock","5A","Mailbock/Helles Bock",1.072,1.064,1.018,1.011,7.4,6.3,40.0,23.0,11.0,6.0],["Bock","5B","Traditional Bock",1.072,1.064,1.019,1.013,7.2,6.3,27.0,20.0,22.0,14.0],["Bock","5C","Doppelbock",1.120,1.072,1.030,1.018,12.0,7.0,30.0,16.0,25.0,6.0],["Bock","5D","Eisbock",1.120,1.078,1.040,1.020,15.0,9.0,40.0,25.0,35.0,18.0],["Light Hybrid Beer","6A","Cream Ale",1.055,1.042,1.012,1.006,5.6,4.2,23.0,15.0,5.0,2.5],["Light Hybrid Beer","6B","Blonde Ale",1.054,1.038,1.013,1.008,5.5,3.8,28.0,15.0,6.0,3.0],["Light Hybrid Beer","6C","Koelsch",1.050,1.044,1.011,1.007,5.2,4.4,30.0,20.0,5.0,3.5],["Light Hybrid Beer","6D","American Wheat or Rye Beer",1.055,1.040,1.013,1.008,5.5,4.0,30.0,15.0,6.0,3.0],["Amber Hybrid Beer","7A","Northern German Altbier",1.054,1.046,1.015,1.010,5.2,4.5,40.0,25.0,19.0,13.0],["Amber Hybrid Beer","7B","California Common Beer",1.054,1.048,1.014,1.011,5.5,4.5,45.0,30.0,14.0,10.0],["Amber Hybrid Beer","7C","Dusseldorf Altbier",1.054,1.046,1.015,1.010,5.2,4.5,50.0,35.0,17.0,13.0],["English Pale Ale","8A","Standard/Ordinary Bitter",1.040,1.032,1.011,1.007,3.8,3.2,35.0,25.0,14.0,4.0],["English Pale Ale","8B","Special/Best/Premium Bitter",1.048,1.040,1.012,1.008,4.6,3.8,40.0,25.0,16.0,5.0],["English Pale Ale","8C","Extra Special/Strong Bitter (English Pale Ale)",1.065,1.048,1.016,1.010,6.2,4.6,55.0,30.0,18.0,6.0],["Scottish and Irish Ale","9A","Scottish Light 60/-",1.035,1.030,1.013,1.010,3.2,2.5,17.0,9.0,17.0,9.0],["Scottish and Irish Ale","9B","Scottish Heavy 70/-",1.040,1.035,1.015,1.010,3.9,3.2,25.0,10.0,17.0,9.0],["Scottish and Irish Ale","9C","Scottish Export 80/-",1.054,1.040,1.016,1.010,5.0,3.9,30.0,15.0,17.0,9.0],["Scottish and Irish Ale","9D","Irish Red Ale",1.060,1.044,1.014,1.010,6.0,4.0,28.0,17.0,18.0,9.0],["Scottish and Irish Ale","9E","Strong Scotch Ale",1.130,1.070,1.035,1.018,10.0,6.5,35.0,17.0,25.0,14.0]];
var agb_grain = [ [744,"Generic",36,2.0,1],[375,"Acid Malt",27,3.0,1],[378,"Amber Malt",35,22.0,1],[379,"Aromatic Malt",36,26.0,1],[380,"Barley Hulls",00,0.0,1],[381,"Barley, Flaked",32,1.7,1],[383,"Barley, Raw",28,2.0,1],[384,"Barley, Torrefied",36,1.7,1],[385,"Biscuit Malt",36,23.0,1],[386,"Black (Patent) Malt",25,500.0,1],[387,"Black Barley (Stout)",25,500.0,1],[388,"Black Malt",34,660.0,1],[389,"Brown Malt",32,65.0,1],[392,"Brumalt",33,23.0,1],[399,"Cara-Pils/Dextrine",33,2.0,1],[400,"Caraamber",35,30.0,1],[401,"Caraaroma",35,130.0,1],[402,"Carafa I",32,337.0,1],[403,"Carafa II",32,412.0,1],[404,"Carafa III",32,525.0,1],[405,"Carafoam",33,2.0,1],[406,"Caramalt",34,15.0,1],[407,"Caramel Wheat Malt",35,46.0,1],[408,"Caramel/Crystal Malt – 10L",35,10.0,1],[409,"Caramel/Crystal Malt – 20L",35,20.0,1],[410,"Caramel/Crystal Malt – 30L",35,30.0,1],[411,"Caramel/Crystal Malt – 40L",34,40.0,1],[412,"Caramel/Crystal Malt – 60L",34,60.0,1],[413,"Caramel/Crystal Malt – 80L",34,80.0,1],[414,"Caramel/Crystal Malt -120L",33,120.0,1],[415,"Caramunich Malt 20",33,20.0,1],[416,"Caramunich Malt 40",33,40.0,1],[417,"Caramunich Malt 60",33,60.0,1],[418,"Carared",35,20.0,1],[763,"Carastan",35,30,1],[419,"Caravienne Malt",34,22.0,1],[420,"Chocolate Malt",28,350.0,1],[423,"Chocolate Rye Malt",31,250.0,1],[424,"Chocolate Wheat Malt",33,400.0,1],[427,"Corn, Flaked",37,1.3,1],[429,"Crystal Rye Malt",34,80.0,1],[430,"Crystal Wheat Malt",34,63.0,1],[435,"Grits",37,1.0,1],[437,"Honey Malt",37,25.0,1],[439,"Lager Malt",38,2.0,1],[442,"Maize, Flaked",34,2.0,1],[444,"Melanoiden Malt",37,20.0,1],[445,"Mild Malt",37,4.0,1],[448,"Munich Malt",37,9.0,1],[449,"Munich Malt – 10L",35,10.0,1],[450,"Munich Malt – 20L",35,20.0,1],[451,"Oats, Flaked",37,1.0,1],[452,"Oats, Malted",37,1.0,1],[455,"Pale Malt (2 Row) Bel",37,3.0,1],[456,"Pale Malt (2 Row) UK",36,3.0,1],[457,"Pale Malt (2 Row) US",36,2.0,1],[458,"Pale Malt (6 Row) US",35,2.0,1],[459,"Pale Malt, Golden Promise",38,3.0,1],[460,"Pale Malt, Halcyon",38,3.0,1],[461,"Pale Malt, Maris Otter",38,3.0,1],[463,"Peat Smoked Malt",34,2.8,1],[464,"Pilsner (2 Row) Bel",36,2.0,1],[465,"Pilsner (2 Row) Ger",37,2.0,1],[466,"Pilsner (2 Row) UK",36,1.0,1],[469,"Rice Hulls",00,0.0,1],[470,"Rice, Flaked",32,1.0,1],[471,"Rice, Instant",32,1.0,1],[472,"Roasted Barley",25,300.0,1],[474,"Rye Malt",29,4.7,1],[475,"Rye, Flaked",36,2.0,1],[476,"Smoked Malt",37,9.0,1],[477,"Special B Malt",30,180.0,1],[478,"Special Roast",33,50.0,1],[480,"Toasted Malt",33,27.0,1],[483,"Victory Malt",34,25.0,1],[484,"Vienna Malt",36,3.5,1],[487,"Wheat Malt, Bel",37,2.0,1],[488,"Wheat Malt, Dark",39,9.0,1],[489,"Wheat Malt, Ger",39,2.0,1],[490,"Wheat, Flaked",35,1.6,1],[491,"Wheat, Roasted",25,425.0,1],[492,"Wheat, Torrified",36,1.7,1],[494,"White Wheat Malt",40,2.4,1],[376,"Amber Dry Extract",44,12.5,0],[377,"Amber Liquid Extract",36,12.5,0],[390,"Brown Sugar, Dark",46,50.0,0],[391,"Brown Sugar, Light",46,8.0,0],[393,"Candi Sugar Soft, Brown",40,40.0,0],[394,"Candi Sugar Syrup, Dark",31,80.0,0],[395,"Candi Sugar, Amber",35,75.0,0],[396,"Candi Sugar, Clear",38,0.5,0],[397,"Candi Sugar, Dark",32,275.0,0],[398,"Cane (Beet) Sugar",46,0.0,0],[425,"Corn Sugar (Dextrose)",46,0.0,0],[426,"Corn Syrup",36,1.0,0],[431,"Dark Dry Extract",44,17.5,0],[432,"Dark Liquid Extract",36,17.5,0],[433,"Dememera Sugar",46,2.0,0],[434,"Extra Light Dry Extract",44,3.0,0],[436,"Honey",35,1.0,0],[438,"Invert Sugar",46,0.0,0],[440,"Light Dry Extract",44,8.0,0],[441,"Lyle's Golden Syrup",36,0.0,0],[443,"Maple Syrup",30,35.0,0],[446,"Milk Sugar (Lactose)",35,0.0,0],[447,"Molasses",36,80.0,0],[454,"Pale Liquid Extract",36,8.0,0],[467,"Pilsner Liquid Extract",36,3.5,0],[468,"Rice Extract Syrup",32,7.0,0],[479,"Sugar, Table (Sucrose)",46,0.0,0],[481,"Treacle",36,100.0,0],[482,"Turbinado",44,10.0,0],[485,"Wheat Dry Extract",44,8.0,0],[486,"Wheat Liquid Extract",36,8.0,0]];
var agb_hops = [ [749,"Generic",3.5],[134,"Admiral",14.5],[135,"Ahtanum",6],[136,"Amarillo",8.5],[137,"Aquila",7.8],[139,"Banner",10.7],[140,"Bramling Cross",6],[141,"Brewer’s Gold",10.5],[142,"Bullion",9.8],[143,"Cascade",5.75],[144,"Centennial",10.5],[145,"Challenger",7.5],[146,"Chinook",13],[230,"Citra",11],[147,"Cluster",7],[148,"Columbia",5.5],[149,"Columbus",15],[150,"Comet",9.5],[151,"Crystal",3.25],[152,"Eroica",13],[153,"First Gold",7.5],[228,"Fuggle",4.75],[154,"Fuggle, US",4.75],[695,"Galaxy",13],[155,"Galena",13],[156,"Glacier",5.6],[157,"Goldings, B.C.",5],[159,"Green Bullet",13.5],[160,"Hallertauer",4.5],[161,"Hallertauer Hersbrucker",4],[162,"Hallertauer Mittelfrueh",4],[163,"Hallertauer, New Zealand",8.5],[164,"Herald",12],[165,"Horizon",12],[227,"Kent Golding",4.75],[158,"Kent Golding, US",4.5],[166,"Liberty",4],[167,"Lublin",5],[168,"Magnum",13],[668,"Millenium",13],[169,"Mt. Hood",6.5],[170,"Newport",11],[171,"Northdown",8.5],[172,"Northern Brewer",9],[173,"Nugget",13],[174,"Orion",7.25],[175,"Pacific Gem",15],[667,"Palisade",7.5],[176,"Pearle",8],[224,"Perle US",8.25],[177,"Phoenix",8],[178,"Pilgrim",11.5],[179,"Pioneer",9],[180,"Premiant (Saaz)",10],[181,"Pride of Ringwood",8.5],[182,"Progress",6.25],[183,"Saaz",3.75],[184,"Santiam",6],[185,"Select Spalt",4.75],[186,"Simcoe",13],[187,"Sladek (Saaz)",7.5],[188,"Sorachi Ace",13.7],[189,"Southern Cross",13],[190,"Spalter",4.5],[191,"Sterling",7.5],[192,"Sticklebract",13.5],[193,"Strisslespalt",4],[194,"Styrian Goldings",5.4],[195,"Summit",18],[196,"Sun",14],[197,"Super Alpha",13],[198,"Target",11],[703,"Teamaker",1.2],[199,"Tettnang",4.5],[705,"Tomahawk",15],[200,"Tradition",6],[201,"Trschitz (Saaz)",3.5],[202,"Ultra",2.75],[203,"Vanguard",5.5],[244,"Vojvodina",8.3],[204,"Warrior",15],[205,"Whitbread Golding Variety (WGV)",6],[206,"Willamette",5],[207,"Zeus",15]];
var agb_yeast = [ [751,"Generic",76.5,"68 – 73",15],[83,"1007 German Ale",75,"55 – 68",11],[84,"1010 American Wheat",76,"58 – 74",10],[85,"1028 London Ale",75,"60 – 72",11],[86,"1056 American Ale",75,"60 – 72",11],[87,"1084 Irish Ale",73,"62 – 72",12],[88,"1098 British Ale",74,"64 – 72",10],[89,"1099 Whitbread Ale",70,"64 – 75",10],[90,"1187 Ringwood Ale",70,"64 – 74",10],[112,"1214 Belgian Abbey",76,"68 – 78",12],[128,"1272 American Ale II",74,"60 – 72",10],[92,"1275 Thames Valley Ale",77,"62 – 72",10],[93,"1318 London Ale III",73,"64 – 74",10],[94,"1332 Northwest Ale",69,"65 – 75",10],[95,"1335 British Ale II",74.5,"63 – 75",10],[96,"1338 European Ale",69,"62 – 72",10],[113,"1388 Belgian Strong Ale",76,"64 – 80",12],[97,"1450 Denny's Favorite 50",75,"60 – 70",10],[98,"1728 Scottish Ale",71,"55 – 75",12],[114,"1762 Belgian Abbey II",75,"65 – 75",12],[696,"1764 Pacman",75,"60 – 72",12],[700,"1882 Thames Valley II",75,"60 – 70",10],[99,"1968 London ESB Ale",33.5,"64 – 72",9],[101,"2000 Budvar Lager",73,"48 – 56",9],[102,"2001 Urquell Lager",74,"48 – 56",9],[103,"2007 Pilsen Lager",73,"48 – 56",9],[104,"2035 American Lager",75,"48 – 58",9],[105,"2042 Danish Lager",75,"46 – 56",9],[106,"2112 California Lager",69,"58 – 68",9],[107,"2112 California Lager",69,"58 – 68",9],[108,"2206 Bavarian Lager",75,"46 – 58",9],[109,"2278 Czech Pils",72,"50 – 58",9],[110,"2308 Munich Lager",72,"48 – 56",9],[100,"2565 Kölsch",75,"56 – 70",10],[111,"2633 Octoberfest Lager Blend",75,"48 – 58",9],[115,"3056 Bavarian Wheat Blend",75,"64 – 74",10],[116,"3068 Weihenstephan Weizen",75,"64 – 75",10],[117,"3278 Belgian Lambic Blend",75,"63 – 75",11],[118,"3333 German Wheat",73,"63 – 75",10],[119,"3333 German Wheat",73,"63 – 75",10],[120,"3522 Belgian Ardennes",74,"65 – 76",12],[121,"3638 Bavarian Wheat",73,"64 – 75",10],[122,"3711 French Saison",80,"65 – 77",12],[123,"3724 Belgian Saison",78,"70 – 95",12],[124,"3763 Roeselare Ale Blend",80,"65 – 85",11],[125,"3787 Trappist High Gravity",76,"64 – 78",12],[126,"3942 Belgian Wheat",74,"64 – 74",12],[127,"3944 Belgian Witbier",74,"62 – 75",12],[14,"WLP001 California Ale Yeast",76.5,"68 – 73",15],[15,"WLP002 English Ale Yeast",66.5,"65 – 68",12],[16,"WLP004 Irish Ale Yeast",71.5,"65 – 68",12],[17,"WLP005 British Ale Yeast",70.5,"65 – 70",10],[18,"WLP006 Bedford British",76,"65 – 70",12],[19,"WLP007 Dry English Ale Yeast",75,"65 – 70",12],[20,"WLP008 East Coast Ale Yeast",72.5,"68 – 73",10],[21,"WLP009 Australian Ale Yeast",72.5,"65 – 70",10],[22,"WLP011 European Ale Yeast",67.5,"65 – 70",12],[23,"WLP013 London Ale Yeast",71,"66 – 71",10],[24,"WLP022 Essex Ale Yeast",73.5,"66 – 70",10],[25,"WLP023 Burton Ale Yeast",72,"68 – 73",10],[26,"WLP028 Edinburgh Scottish Ale Yeast",72.5,"65 – 70",12],[27,"WLP029 German Ale/ Kölsch Yeast",75,"65 – 69",10],[28,"WLP036 Dusseldorf Alt Yeast",68.5,"65 – 69",10],[29,"WLP037 Yorkshire Square Ale Yeast",70,"65 – 69",12],[30,"WLP038 Manchester Ale Yeast",72,"65 – 70",12],[31,"WLP039 Nottingham Ale Yeast",77.5,"66 – 70",10],[32,"WLP041 Pacific Ale Yeast",67.5,"65 – 68",10],[33,"WLP051 California Ale V Yeast",72.5,"66 – 70",12],[34,"WLP060 American Ale Yeast Blend",76,"68 – 72",12],[35,"WLP072 French Ale",71.5,"63 – 73",10],[36,"WLP080 Cream Ale Yeast Blend",77.5,"65 – 70",10],[37,"WLP099 Super High Gravity Ale Yeast",82.5,"65 – 69",18],[38,"WLP300 Hefeweizen Ale Yeast",74,"68 – 72",10],[39,"WLP320 American Hefeweizen Ale Yeast",72.5,"65 – 69",10],[40,"WLP351 Bavarian Weizen Yeast",75,"66 – 70",10],[41,"WLP380 Hefeweizen IV Ale Yeast",76.5,"66 – 70",10],[42,"WLP400 Belgian Wit Ale Yeast",76,"67 – 74",10],[43,"WLP410 Belgian Wit II Ale Yeast",72.5,"67 – 74",10],[44,"WLP500 Trappist Ale Yeast",77.5,"65 – 72",15],[45,"WLP510 Belgian Bastogne Ale Yeast",77,"66 – 72",15],[46,"WLP515 Antwerp Ale Yeast",76.5,"67 – 70",10],[47,"WLP530 Abbey Ale Yeast",77.5,"66 – 72",15],[48,"WLP540 Abbey IV Ale Yeast",78,"66 – 72",15],[49,"WLP545 Belgian Strong Ale Yeast",81.5,"66 – 72",15],[50,"WLP550 Belgian Ale Yeast",81.5,"68 – 78",12],[51,"WLP565 Belgian Saison I Yeast",70,"68 – 75",10],[52,"WLP566 Belgian Saison II Yeast",81.5,"68 – 78",10],[53,"WLP568 Belgian Style Saison Ale Yeast Blend",75,"70 – 80",10],[54,"WLP570 Belgian Golden Ale Yeast",75.5,"68 – 75",15],[55,"WLP575 Belgian Style Ale Yeast Blend",77,"68 – 75",12],[56,"WLP700 Flor Sherry Yeast",82.5,"70 – 75",10],[57,"WLP705 Sake Yeast",82.5,"70 – 75",10],[58,"WLP715 Champagne Yeast",77.5,"70 – 75",10],[59,"WLP718 Avize Wine Yeast",82.5,"60 – 90",10],[60,"WLP720 Sweet Mead/Wine Yeast:",72.5,"70 – 75",15],[61,"WLP727 Steinberg-Geisenheim Wine Yeast",82.5,"50 – 90",14],[62,"WLP730 Chardonnay White Wine Yeast",82.5,"50 – 90",10],[63,"WLP735 French White Wine Yeast",82.5,"60 – 90",10],[64,"WLP740 Merlot Red Wine Yeast",82.5,"60 – 90",10],[65,"WLP749 Assmanshausen Wine Yeast",82.5,"50 – 90",10],[66,"WLP750 French Red Wine Yeast",82.5,"60 – 90",10],[67,"WLP760 Cabernet Red Wine Yeast",82.5,"60 – 90",10],[68,"WLP770 Suremain Burgundy Wine Yeast",82.5,"60 – 90",10],[69,"WLP775 English Cider Yeast",82.5,"68 – 75",12],[70,"WLP800 Pilsner Lager Yeast",74.5,"50 – 55",10],[71,"WLP802 Czech Budejovice Lager Yeast",77.5,"50 – 55",10],[72,"WLP810 San Francisco Lager Yeast",67.5,"58 – 65",12],[73,"WLP820 Oktoberfest/Märzen Lager Yeast",69,"52 – 58",12],[74,"WLP830 German Lager Yeast",76.5,"50 – 55",10],[75,"WLP833 German Bock Lager Yeast",73,"48 – 55",12],[76,"WLP838 Southern German Lager Yeast",72,"50 – 55",10],[77,"WLP840 American Lager Yeast",77.5,"50 – 55",10],[78,"WLP850 Copenhagen Lager Yeast",75,"50 – 58",10],[79,"WLP862 Cry Havoc",68,"68 – 74",10],[80,"WLP885 Zurich Lager Yeast",75,"50 – 55",18],[81,"WLP920 Old Bavarian Lager Yeast",69.5,"50 – 55",12],[82,"WLP940 Mexican Lager Yeast",74,"50 – 55",10]];
var agb_water = [ [772,"Custom",0,0,0,0,0,0],[788,"Burton-on-Trent",352,24,320,820,44,16],[775,"Dortmund",225,40,220,120,60,60],[789,"Dublin",118,4,319,54,12,19],[786,"Edinburgh",100,18,160,105,20,45],[787,"London",52,32,104,32,86,34],[784,"Munich",109,21,171,79,2,36],[774,"Pilsen",10,3,3,4,3,4],[782,"Vienna",163,68,243,216,8,39]];
[/js]

Everything?

Here is all the code together:

One Response to “Caching Application Data (WordPress & Beer)”


  1. gabriel nagmay (dot com) | Archive » WordPress and Beer: Homebrew web applications with WP Says:

    […] Caching Application Data […]

Leave a Reply

You know you want to...