function ajaxCache(type, on, lifetime) {
        if (on) {
            this.on = true;
        } else
            this.on = false;

        // set default cache lifetime
        if (lifetime != null) {
            this.defaultLifetime = lifetime;
        }

        // set type
        this.type = type;

        // set cache functions according to type
        switch (this.type) {
            case 'URL':
                this.put = this.put_url;
                break;
            case 'GET':
                this.put = this.put_GET;
                break;
        }

    }
Loads referenced JSON options.

@param {Object|String} resource Resource to be loaded.
@param {Function} onSuccess onSuccess callback.
@param {Function} onError onError callback.