0
votes

I have a problem with http header - cache-control: max-age=1234 My sources have that header, but any way to send request and receive 304. I need May be I missed something? And one more, source besides cache-control: max-age=1234 in "response headers" has cache-control: max-age=0 in "request headers", may be it's affecting.

One of my resources response header, Example:

  1. Remote Address:10.6.237.13:443 Request Request Method:GET Status Code:304 Not Modified

    1. Response Headers: view source Cache-Control:max-age=5184000 Connection:Keep-Alive Date:Thu, 13 Aug 2015 05:31:29 GMT Expires:Mon, 12 Oct 2015 05:31:29 GMT Keep-Alive:timeout=30, max=98 Server:Apache/2.2.9 (Win32) mod_jk/1.2.37 mod_ssl/2.2.9 OpenSSL/1.0.2d Vary:Accept-Encoding,User-Agent
    2. Request Headers: view source Accept:image/webp,/;q=0.8 Accept-Encoding:gzip, deflate, sdch Accept-Language:en-US,en;q=0.8 Cache-Control:max-age=0 Connection:keep-alive Cookie:JSESSIONID=2D90E37C3627CE74F7ABF63BC3C023F1.dev; _gat=1; _ga=GA1.2.344051414.1437552094 Host:demo.vts.epam.com If-Modified-Since:Wed, 12 Aug 2015 13:49:06 GMT Pragma:no-cache Referer User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36
2

2 Answers

0
votes

It really depends on how your'e opening the link.

i) If your'e refreshing the page with F5, then browser will send a Conditional Request to the Server to check if the resource has been modified.

ii) Pressing Control + F5 is like a un-conditional refresh of all the contents of the page, irrespective of the cash.

iii) If you just press ENTER in the URL Bar, then the browser will take the page from it's cache and will not request the server until the max-age directive has expired.

0
votes

I have faced the same issue and found the cause on the HTTP Cache Manager Documentation

"Responses with a Vary header will not be cached." and this is your case.

I didn't find the solution yet, except to not use "Retrieve All Embedded Ressources" (in HTTP Request advanced) and send each of my request one by one...

Maybe it can help ! Thx