Moved out html storage from loop

A few reasons to this:
 - Storage and compression ran once each Ajax call
 - Overloading the procedure

Also, I set the ajax async to false as the html has
to be fetched first.