JavaScript to cache AJAX requests using localStorage.