jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob <b.mel...@gmail.com>
Subject Re: HTTP Cache Manager is not caching static files
Date Fri, 31 Jul 2015 05:58:06 GMT
Solution: Adding "HTTP Header Manager" on top of test plan and header 
"Cache-Control:max-age=3600,must-revalidate" fixed the issue.

Cause: "HTTP(S) Test Script Recorder" when records it's setting 
"max-age=0" and for this reason caching is not working. Seems bug?

On 30/07/15 13:06, Steven Swor wrote:
> +1 for Felix's response. Try running the same scenario manually in a web
> browser with developer tools open, and see if any of the requests show up
> as served from cache or if they are 200 status responses every time. If
> there is no mention of local cache, and no 304 status responses, then
> jmeter is working correctly and the site you're testing against simply
> isn't set up to allow caching.
>
> On Thu, Jul 30, 2015 at 3:14 PM, Felix Schumacher <
> felix.schumacher@internetallee.de> wrote:
>
>>
>> Am 29. Juli 2015 21:22:46 MESZ, schrieb Felix Schumacher <
>> felix.schumacher@internetallee.de>:
>>> Am 29.07.2015 um 13:59 schrieb Bob:
>>>> I think it might be because of headers in "HTTP Header Manager" as
>>>> request was recorded via "HTTP(S) Test Script Recorder". But don't
>>>> know how to solve the problem. Any best practices sending HTTP
>>> headers
>>>> to manage concurrent pool and cache option?
>>> You could have told us, which version of jmeter you are using.
>>>
>>> If you are using a current nightly build, chances are, that you are
>>> using a new feature of the cache manager. Your response headers show a
>>> "Vary" header. Those requests will not be cached anymore.
>>>
>>> If you are using a stable build, it might be that you stumbled upon a
>>> bug.
>> Having slept over it and rereading the documentation I think it will not
>> cache responses, that are missing etag, last-modified or
>> cache-control/expires headers.
>>
>> None of those headers are in your response, so the cache manager will not
>> save your responses.
>>
>> For more info see
>> http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cache_Manager
>>
>> Regards,
>> Felix
>>
>>> If I read the code correct, than there is missing an else statement
>>> with
>>> a "return true;" in CacheManager#inCache(URL) for the if statement for
>>> "entry == null".
>>>
>>> But on the other hand, the javadocs for that method and the behaviour
>>> of
>>> the method match, so it might be intended.
>>>
>>> Regards,
>>>   Felix
>>>> On 29/07/15 13:44, Bob wrote:
>>>>> Hi,
>>>>>
>>>>> I'm using "HTTP Cache Manager" with default settings and when I run
>>>>> test with 1 user, 2 iterations static files are not being cached.
>>>>> When I increase iteration and run test, the caching behavior is the
>>>>> same, it's downloading static files each time from server instead of
>>>>> using from cache. Here is log from headers:
>>>>>
>>>>> Thread Name: Thread Group 1-1
>>>>> Sample Start: 2015-07-29 13:38:37 UZT
>>>>> Load time: 5293
>>>>> Connect Time: 0
>>>>> Latency: 246
>>>>> Size in bytes: 280405
>>>>> Headers size in bytes: 11512
>>>>> Body size in bytes: 268893
>>>>> Sample Count: 1
>>>>> Error Count: 0
>>>>> Response code: 200
>>>>> Response message: OK
>>>>>
>>>>> Response headers:
>>>>> HTTP/1.1 200 OK
>>>>> Date: Wed, 29 Jul 2015 08:38:37 GMT
>>>>> Server: Apache/2.4.10 (Debian)
>>>>> X-Powered-By: PHP/5.6.9-0+deb8u1
>>>>> Vary: Accept-Encoding
>>>>> Content-Type: text/html; charset=utf-8
>>>>> Content-Length: 38259
>>>>> Connection: Keep-Alive
>>>>> Content-Encoding: gzip
>>>>>
>>>>>
>>>>> HTTPSampleResult fields:
>>>>> ContentType: text/html; charset=utf-8
>>>>> DataEncoding: utf-8
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message