You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2016/08/09 15:27:33 UTC
[Bug 59962] New: Cache Manager does not update expires date when
response code is 304.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59962
Bug ID: 59962
Summary: Cache Manager does not update expires date when
response code is 304.
Product: JMeter
Version: 3.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P2
Component: HTTP
Assignee: issues@jmeter.apache.org
Reporter: kimono.outfit.am@gmail.com
Created attachment 34118
--> https://bz.apache.org/bugzilla/attachment.cgi?id=34118&action=edit
jmx for reproduction
Cache Manager does not update expires date when response code is 304.
If server sends new Expires header with 304, JMeter should not send this
request until expired when "Use Cache-Control/Expires header" option is
checked.
This is because cacheable response code is limited to 2xx range in isCacheable
method(CacheManager.java).
To reproduce with Apache HTTP Server 2.4:
Add settings below to httpd.conf and run attached jmx.
----
LoadModule expires_module modules/mod_expires.so
<IfModule expires_module>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
</IfModule>
----
Expected result:
3rd request of attached jmx should not be sent.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 59962] Cache Manager does not update expires date when response
code is 304.
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59962
Philippe Mouawad <p....@ubik-ingenierie.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
CC| |p.mouawad@ubik-ingenierie.c
| |om
--- Comment #1 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Hello,
Thanks for report.
Could you set Filename in your View Results Tree and save all fields to XML
format, run your test and send the output ?
An alternative would be to write a Test method in TestCacheManagerBase.
I am not sure to understand.
1/ First request is sent, and says to cache access + 5 seconds
2/ Your timer runs for 6 seconds, so second request should get a 200, not a 304
3/ And yes the 3rd request should come from cache. So I don't understand your
note on "This is because cacheable response code is limited to 2xx range in
isCacheable method(CacheManager.java)."
Thanks
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 59962] Cache Manager does not update expires date when response
code is 304.
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59962
Philippe Mouawad <p....@ubik-ingenierie.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Sat Sep 3 22:15:03 2016
New Revision: 1759137
URL: http://svn.apache.org/viewvc?rev=1759137&view=rev
Log:
Bug 59962 - Cache Manager does not update expires date when response code is
304.
Bugzilla Id: 59962
Modified:
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java
jmeter/trunk/xdocs/changes.xml
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 59962] Cache Manager does not update expires date when response
code is 304.
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59962
Kimono <ki...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS|Windows NT |All
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 59962] Cache Manager does not update expires date when response
code is 304.
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59962
--- Comment #2 from Kimono <ki...@gmail.com> ---
Created attachment 34155
--> https://bz.apache.org/bugzilla/attachment.cgi?id=34155&action=edit
rsult xml file
Thanks for your reply.
Detail of expected result is below.
1.1st request is sent, and server returns 200 response with expires date
"access plus 5 seconds".
2.After 6 seconds(timer), 2nd request is sent, and server returns 304 response
with new expires date "access plus 5 seconds".
3.After 3 seconds(timer), 3rd request should not be sent because cache is not
expired.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 59962] Cache Manager does not update expires date when response
code is 304.
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59962
--- Comment #3 from Kimono <ki...@gmail.com> ---
I wrote a simple test method for TestCacheManagerBase.
----
@Test
public void testExpiresBug59962() throws Exception {
this.cacheManager.setUseExpires(true);
this.cacheManager.testIterationStart(null);
assertNull("Should not find entry", getThreadCacheEntry(LOCAL_HOST));
assertFalse("Should not find valid entry",
this.cacheManager.inCache(url));
long start = System.currentTimeMillis();
setExpires(makeDate(new Date(start + 2000)));
cacheResultWithGivenCode("304");
assertNotNull("Should find entry", getThreadCacheEntry(LOCAL_HOST));
assertTrue("Should find valid entry", this.cacheManager.inCache(url));
sleepTill(start + 2010);
assertNotNull("Should find entry", getThreadCacheEntry(LOCAL_HOST));
assertFalse("Should not find valid entry",
this.cacheManager.inCache(url));
}
----
--
You are receiving this mail because:
You are the assignee for the bug.