Version: (using KDE 3.5.8) Installed from: Debian stable Packages OS: Linux The server sends the document with these headers: Date: Sun, 17 Feb 2008 01:15:18 GMT Expires: Sun, 17 Feb 2008 01:15:19 GMT Cache-Control: post-check=0, pre-check=0 Pragma: no-cache Etag: "2406b-13a4-e93a4cc0" Content-Length: 47 Content-Type: text/html; charset=UTF-8 200 OK When user comes to the same page again (through link or via refresh - no difference) the browser does not send If-None-Match header (as it should) but instead requests the document again. That way it never receives 304 response and wastes bandwidth and time. The same thing is true for Last-Modified / If-Modified-Since. I know this is no guarantee for correctness of the server headers, but IE, FF & Opera operate as expected. I have also tried to use many different sets of Cache-Control headers, but to no avail. Also, a long time ago when I was setting up a cache-aware application I have checked this and I think it worked then (with older konqi)- it no longer works. I have default cache settings. Great app btw! :)
Update: the page is not even saved in cache with above headers. Without Cache-Control and Pragma headers the page is saved in cache, but Konqueror still doesn't use If-None-Match when checking for a new copy.
I do not see in the w3c http 1.1 definition (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) the Cache-Control: post-check=0, pre-check=0. Anyway, if the content expires only 1 second after it is sent by the server, it should be asked again by the browser (after 1 second).
I have this same issue, using 4.2.4 on ubuntu. Firefox has no issues for both of the samples below, sending If-Modified-Since, or If-None-Exist on it's requests. So with firefox/ie I get 304 and no content, but with kronqueror I get the whole picture again. The point of the Expires/Cache-Control is to allow content caching but still verify with the webserver so I know if it's been updated and to check permissions. GET /showpic.php?UID=22337 HTTP/1.1 Host: images.digitalexpressions.nu Connection: Keep-Alive User-Agent: Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.4 (like Gecko) Referer: http://www.digitalexpressions.nu:80/viewdiary.php?DID=22179 Accept: image/png, image/jpeg, video/x-mng, image/jp2, image/gif;q=0.5,*/*;q=0.1 Accept-Encoding: x-gzip, x-deflate, gzip, deflate Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5 Accept-Language: en-US, en Cookie: DESID=f74c233873432f7d6c86a428620b4732 HTTP/1.1 200 OK X-Powered-By: PHP/4.4.3 Expires: Thu, 19 Nov 1981 08:52:00 GMT Pragma: no-cache Cache-Control: no-cache, must-revalidate, post-check=864000, pre-check=864000 Last-Modified: Thu, 28 May 2009 23:52:24 GMT Content-Type: image/jpeg Content-Length: 50123 Date: Sat, 03 Oct 2009 18:15:34 GMT Server: lighttpd/1.4.23 GET /showpic.php?UID=22337 HTTP/1.1 Host: images.digitalexpressions.nu Connection: Keep-Alive User-Agent: Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.4 (like Gecko) Referer: http://www.digitalexpressions.nu:80/viewdiary.php?DID=22179 Accept: image/png, image/jpeg, video/x-mng, image/jp2, image/gif;q=0.5,*/*;q=0.1 Accept-Encoding: x-gzip, x-deflate, gzip, deflate Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5 Accept-Language: en-US, en Cookie: DESID=f74c233873432f7d6c86a428620b4732 HTTP/1.1 200 OK X-Powered-By: PHP/4.4.3 Expires: Thu, 19 Nov 1981 08:52:00 GMT Pragma: no-cache Cache-Control: no-cache, must-revalidate, post-check=864000, pre-check=864000 Last-Modified: Thu, 28 May 2009 23:52:24 GMT Content-Type: image/jpeg Content-Length: 50123 Date: Sat, 03 Oct 2009 18:15:34 GMT
(In reply to comment #3) > I have this same issue, using 4.2.4 on ubuntu. > > Firefox has no issues for both of the samples below, sending If-Modified-Since, > or If-None-Exist on it's requests. So with firefox/ie I get 304 and no content, > but with kronqueror I get the whole picture again. > The point of the Expires/Cache-Control is to allow content caching but still > verify with the webserver so I know if it's been updated and to check > permissions. > > GET /showpic.php?UID=22337 HTTP/1.1 > Host: images.digitalexpressions.nu > Connection: Keep-Alive > User-Agent: Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.4 (like > Gecko) > Referer: http://www.digitalexpressions.nu:80/viewdiary.php?DID=22179 > Accept: image/png, image/jpeg, video/x-mng, image/jp2, > image/gif;q=0.5,*/*;q=0.1 > Accept-Encoding: x-gzip, x-deflate, gzip, deflate > Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5 > Accept-Language: en-US, en > Cookie: DESID=f74c233873432f7d6c86a428620b4732 > > HTTP/1.1 200 OK > X-Powered-By: PHP/4.4.3 > Expires: Thu, 19 Nov 1981 08:52:00 GMT > Pragma: no-cache > Cache-Control: no-cache, must-revalidate, post-check=864000, pre-check=864000 > Last-Modified: Thu, 28 May 2009 23:52:24 GMT > Content-Type: image/jpeg > Content-Length: 50123 > Date: Sat, 03 Oct 2009 18:15:34 GMT > Server: lighttpd/1.4.23 > > GET /showpic.php?UID=22337 HTTP/1.1 > Host: images.digitalexpressions.nu > Connection: Keep-Alive > User-Agent: Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.4 (like > Gecko) > Referer: http://www.digitalexpressions.nu:80/viewdiary.php?DID=22179 > Accept: image/png, image/jpeg, video/x-mng, image/jp2, > image/gif;q=0.5,*/*;q=0.1 > Accept-Encoding: x-gzip, x-deflate, gzip, deflate > Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5 > Accept-Language: en-US, en > Cookie: DESID=f74c233873432f7d6c86a428620b4732 > > HTTP/1.1 200 OK > X-Powered-By: PHP/4.4.3 > Expires: Thu, 19 Nov 1981 08:52:00 GMT > Pragma: no-cache > Cache-Control: no-cache, must-revalidate, post-check=864000, pre-check=864000 > Last-Modified: Thu, 28 May 2009 23:52:24 GMT > Content-Type: image/jpeg > Content-Length: 50123 > Date: Sat, 03 Oct 2009 18:15:34 GMT If Firefox caches such content, then you need to report that to them. There is no way it should cache a content that includes not one, not two, but three header directives telling you not to cache the content! Expires: Thu, 19 Nov 1981 08:52:00 GMT Pragma: no-cache Cache-Control: no-cache, must-revalidate, post-check=864000, pre-check=864000