Red Hat Bugzilla – Bug 535780
Agent jar shouldn't be cached on client browser
Last modified: 2013-09-02 03:27:04 EDT
This problem came up from customer problem report:
From a newly installed JON 2.3 server, the browser will download "rhq-enterprise-agent-1.2.0.GA.jar" because the browser cached the agent jar previously installed. Please note the download URL is "http://<host>:7080/agentupdate/download" and the URL doesn't have the file name.
I didn't notice that 1.2.0.GA jar was the old one when I installed it. I installed the 1.2 jar - running the rhq-agent.sh, I got the following:
[fminamot@localhost bin]$ ./rhq-agent.sh
RHQ 1.2.0.GA  (null)
This version of the agent is not supported by the server - an agent update must be applied
The agent update thread has started - will begin the agent auto-update now!
The agent will wait for  threads to die
Failed to start the agent
Downloaded the agent update binary to [/home/fminamot/jboss/rhq-enterprise-agent-1.3.0.GA.jar]
Missing the envvar [RHQ_AGENT_JAVA_EXE_FILE_PATH] - will try to find a Java executable to use.
Will use the Java executable [/usr/java/jdk1.6.0_16/jre/bin/java]
Now executing agent update - if all goes well, this is the last you will hear of this agent: [ProcessExecution: executable=[/usr/java/jdk1.6.0_16/jre/bin/java], args=[[-jar, /home/fminamot/jboss/rhq-enterprise-agent-1.3.0.GA.jar, --pause=20000, --update=/home/fminamot/jboss/rhq-agent]], env-vars=[null], working-dir=[/home/fminamot/jboss], wait=, capture-output=[false], kill-on-timeout=[false], executable-is-command=[true]]
RHQ server should add "no-cache" to the download response header in order to prevent caching the agent jar.
We can avoid this trouble by cleaning the browser cache before installation but there is a better way to disable cache by the server side .
So I think RHQ server should add "no-cache" to the download response header in order to prevent caching the agent jar.
Current HTTP request/response are as follows:
GET /agentupdate/download HTTP/1.0
User-Agent: Wget/1.11.4 (Red Hat modified)
HTTP/1.1 200 OK
X-Powered-By: Servlet 2.4; JBoss-4.2.0.CR2 (build: SVNTag=JBoss_4_2_0_CR2 date=200704160918)/Tomcat-5.5
Content-Disposition: attachment; filename=rhq-enterprise-agent-1.3.0.GA.jar
Last-Modified: Thu, 17 Sep 2009 03:28:46 GMT
Date: Thu, 24 Sep 2009 04:24:41 GMT
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2440
mass add of key word FutureFeature to help track
i thought I added all the different no cache headers to the response. I'll double check this.
git commit 1aacb18
I added the following response headers, which should disable caching:
Cache-Control: no-cache, no-store
I added this on all the download servlets - agent, CLI, bundle deployer tool and connectors.
documenting the response headers as follows (from FF Firebug)
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.