jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1359858 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
Date Tue, 10 Jul 2012 19:50:45 GMT
Author: sebb
Date: Tue Jul 10 19:50:45 2012
New Revision: 1359858

URL: http://svn.apache.org/viewvc?rev=1359858&view=rev
Log:
no-cache responses should be stored, but must be revalidated, so don't store an expiry date
for them
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=1359858&r1=1359857&r2=1359858&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
Tue Jul 10 19:50:45 2012
@@ -157,14 +157,12 @@ 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(MAX_AGE)) {
+            if(cacheControl != null) {
+                // if no-cache is present, ensure that expiresDate remains null, which forces
revalidation
+                if(cacheControl.contains(MAX_AGE) && ! cacheControl.contains("no-cache"))
{
                     long maxAgeInSecs = Long.parseLong(
                             cacheControl.substring(cacheControl.indexOf(MAX_AGE)+MAX_AGE.length())
                                 .split("[, ]")[0] // Bug 51932 - allow for optional trailing
attributes



Mime
View raw message