 			if response?.outputFiles?
 				for file in response?.outputFiles
 					fileByPath[file.path] = file
+
+			# prepare query string
+			qs = {}
+			# add a query string parameter for the compile group
+			if response.compileGroup?
+				ide.compileGroup = qs.compileGroup = response.compileGroup
+			# add a query string parameter for the clsi server id
+			if response.clsiServerId?
+				ide.clsiServerId = qs.clsiserverid = response.clsiServerId
 
 			if response.status == "timedout"
 				$scope.pdf.view = 'errors'

				# check if we need to bust cache (build id is unique so don't need it in that case)
				if not fileByPath['output.pdf']?.build?
					qs.cache_bust = "#{Date.now()}"
				# add a query string parameter for the compile group
				if response.compileGroup?
					$scope.pdf.compileGroup = response.compileGroup
					qs.compileGroup = "#{$scope.pdf.compileGroup}"
				if response.clsiServerId?
					qs.clsiserverid = response.clsiServerId
					ide.clsiServerId = response.clsiServerId
				# convert the qs hash into a query string and append it
				$scope.pdf.qs = createQueryString qs
				$scope.pdf.url += $scope.pdf.qs
				# Save all downloads as files
				qs.popupDownload = true
				$scope.pdf.downloadUrl = "/project/#{$scope.project_id}/output/output.pdf" + createQueryString(qs)

				opts =
					method:"GET"
					params:
						compileGroup:ide.compileGroup
						clsiserverid:ide.clsiServerId
				if file?.url?  # FIXME clean this up when we have file.urls out consistently
					opts.url = file.url
