主权项 |
1. A method of caching resources corresponding to a webpage on a client, comprising:
determining by a processor a hierarchy of a plurality of storage mechanisms available on the client based at least in part on performance of the plurality of storage mechanisms, the hierarchy comprising a plurality of levels to which each storage mechanism may be assigned; receiving a request to cache a first resource corresponding to a webpage; selecting one of the plurality of storage mechanisms for caching the first resource based at least in part on the hierarchy; storing the first resource in the selected storage mechanism of the hierarchy; receiving a request to retrieve a second resource; and retrieving the second resource from the hierarchy of the plurality of storage mechanisms, wherein retrieving the second resource comprises searching for the second resource by iteratively walking through at least some of the plurality of levels of the hierarchy, wherein in the event that the second resource is not found by iteratively walking through at least some of the plurality of levels of the hierarchy, the second resource is retrieved from the browser cache, and the second resource retrieved from the browser cache is stored in the hierarchy of the plurality of storage mechanisms. |