Browser-based caching for remote resources
===

I have two REST-ful resources on my server:

    /someEntry/{id}
    Response:
    {
        someInfoAboutEntry: ...,
        entryTypeUrl: "/entryType/12345"
    }

and

    /entryType/{id}
    Response:
    {
        someInfoAboutEntryType: ...
    }

The `entryTypeUrl` is used to fetch additional data about the type of this entry from the different URL. It will be bound to some "Detailed information" button near each entry. There can be many (let's say 100) entries, while there are only 5 types (so most entries point to same `entryTypeUrl`.

I'm building a Javascript client to access those resources. Should I cache `entryType` results in my Javascript code, or should I rely on the browser to cache the data for me and dispatch XHR requests every time user clicks the "Detailed information" button?

As far as I see it, both approaches should work just fine. The second one (always dispatching requests) will result in clearer code though. Should I stick to it, or are there some points I'm not aware of?

Thanks in advance.