Factored out bits common to resource caches, added global limit on number of
resources being requested at any one time.