Set cache headers on upload.
The original script uploads all of the files and then sets caching headers according to the application needs as a second pass. This modification sets a no cache header on everything as it uploads before setting the caching headers as before on a second pass.