moved the gzipping operation so it only happens if the file needs updating