You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2012/07/08 16:56:27 UTC
svn commit: r1358753 -
/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
Author: pmouawad
Date: Sun Jul 8 14:56:27 2012
New Revision: 1358753
URL: http://svn.apache.org/viewvc?rev=1358753&view=rev
Log:
Bug 53522 - Cache Manager should not store at all response with header "no-cache" and store other types of Cache-Control having max-age value
Bugzilla Id: 53522
Modified:
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java?rev=1358753&r1=1358752&r2=1358753&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java Sun Jul 8 14:56:27 2012
@@ -157,13 +157,13 @@ public class CacheManager extends Config
if (log.isDebugEnabled()){
log.debug("SET(both) "+url + " " + cacheControl + " " + lastModified + " " + " " + expires + " " + etag);
}
+ if(cacheControl != null && cacheControl.contains("no-cache")) {
+ return;
+ }
Date expiresDate = null; // i.e. not using Expires
if (useExpires) {// Check that we are processing Expires/CacheControl
final String MAX_AGE = "max-age=";
- if(cacheControl != null) {
- if(cacheControl.contains("no-cache")) {
- return;
- }
+ if(cacheControl != null) {
if(cacheControl.contains(MAX_AGE)) {
long maxAgeInSecs = Long.parseLong(
cacheControl.substring(cacheControl.indexOf(MAX_AGE)+MAX_AGE.length())