Bug 535780 - (RHQ-2440) Agent jar shouldn't be cached on client browser
Agent jar shouldn't be cached on client browser
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Usability (Show other bugs)
unspecified
All All
low Severity medium (vote)
: ---
: ---
Assigned To: John Mazzitelli
http://jira.rhq-project.org/browse/RH...
: FutureFeature, Improvement
Depends On:
Blocks: rhq4
  Show dependency treegraph
 
Reported: 2009-09-24 15:33 EDT by Mark Drilling
Modified: 2013-09-02 03:27 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-02 03:27:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Mark Drilling 2009-09-24 15:33:00 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 [3862] (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 [5] threads to die
Failed to start the agent
org.rhq.core.clientapi.server.core.AgentNotSupportedException
at org.rhq.enterprise.agent.AgentMain.waitForServer(AgentMain.java:1518)
at org.rhq.enterprise.agent.AgentMain.start(AgentMain.java:619)
at org.rhq.enterprise.agent.AgentMain.main(AgentMain.java:398)
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=[0], capture-output=[false], kill-on-timeout=[false], executable-is-command=[true]]
----

Proposed Solution:
====================================
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 [1][2].

So I think RHQ server should add "no-cache" to the download response header in order to prevent caching the agent jar.

[1] http://blog.httpwatch.com/2008/10/15/two-important-differences-between-firefox-and-ie-caching/
[2] http://onjava.com/onjava/excerpt/jebp_3/index2.html

Current HTTP request/response are as follows:

-----
GET /agentupdate/download HTTP/1.0

User-Agent: Wget/1.11.4 (Red Hat modified)

Accept: */*

Host: 10.64.193.190:7080

Connection: Keep-Alive



HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

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

Content-Type: application/octet-stream

Content-Length: 9883586

Date: Thu, 24 Sep 2009 04:24:41 GMT

Connection: keep-alive
-----

Comment 1 Red Hat Bugzilla 2009-11-10 16:04:30 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2440
Comment 2 wes hayutin 2010-02-16 12:10:13 EST
mass add of key word FutureFeature to help track
Comment 3 John Mazzitelli 2011-02-17 12:03:58 EST
i thought I added all the different no cache headers to the response. I'll double check this.
Comment 4 John Mazzitelli 2011-02-18 15:47:52 EST
git commit 1aacb18

I added the following response headers, which should disable caching:

Cache-Control: no-cache, no-store
Expires: -1
Pragma: no-cache

I added this on all the download servlets - agent, CLI, bundle deployer tool and connectors.
Comment 5 Mike Foley 2011-04-20 15:07:07 EDT
documenting the response headers as follows (from FF Firebug)

Pragma	no-cache
Cache-Control	no-cache

verified.
Comment 6 Heiko W. Rupp 2013-09-02 03:27:04 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.

Note You need to log in before you can comment on or make changes to this bug.