Simple cache mechanism? In my system I frequently require data by Ajax requests. For example, different lists, content of modal dialogs, etc. This data can't be changed after request, so I wrote cache mechanism which stores Ajax result and then before Ajax request checks is there stored data.
Here is example:

YFeX.cache = { }; // YFex is my own namespace

$('#account_modal_button').click(function () {
    if (YFeX.cache.account_modal !== undefined) {
        YFeX.modal(YFeX.cache.account_modal.title, YFeX.cache.account_modal.body);
    } else {
        $.ajax({
            type:'GET',
            url:'/?/login',
            dataType:'json',
            context:$(this),
            success:function (data) {
                YFeX.cache.account_modal = data.modal;
                // YFeX.modal will be called automatically
            }
        });
    }
    return false;
});


Are there any 'bad' parts in my solution?
From a once over;


Unless YFeX is also a constructor, it should be yFex
lowerCamelCase is good for you: account_modal -> accountModal
I would store YFeX.cache.account_modal into a var cachedAccountModal so that you do not have to repeat YFeX.cache.account_modal all the time
Your code is very optimistic, you should also deal with fail
Consider using the shorthand $.get()


Other than that, the code looks fine to me.