
var resourcer = require('resourcer');

this.Cache = function (options) {
    this.size = 0;
    this.store = {};
};

this.Cache.prototype = {
    get: function (id) {
        return this.store[id.toString()];
    },
    put: function (id, obj) {
        this.store[id] = obj;
        if (! this.has(id)) { this.size ++ }
    },
    purge: function (id) {
        if (id) { delete(this.store[id]) }
        else    { this.store = {} }
    },
    has: function (id) {
        return id in this.store;
    }
};

@@ -244,38 +244,8 @@
 ) %7B%0A
-        this.store%5Bid%5D = obj;%0A
     
@@ -285,16 +285,46 @@
 ze ++ %7D%0A
+        this.store%5Bid%5D = obj;%0A
     %7D,%0A 

save to cache *after* incrementing. >,>