Update resource cache after all AJAX requests.

Resolves #334