An exemplary method for intelligently caching applications and data on a gateway
comprises the steps of calculating a cache benefit index for a set of files, the
cache benefit index measuring a total benefit for caching the set of files, determining
whether to cache the set of files on a local file system based on the cache benefit
index, caching the set of files on the local file system, and updating a set of
tables in a gateway database based on the caching.