Bug 17895 - Safari not sending If-Modified-Since header
Summary: Safari not sending If-Modified-Since header
Status: RESOLVED DUPLICATE of bug 18972
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac (Intel) OS X 10.5
: P2 Major
Assignee: Nobody
URL: http://test.ismfilms.com
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-17 08:40 PDT by Ryan Warnick
Modified: 2008-05-12 10:19 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Warnick 2008-03-17 08:40:40 PDT
I am trying to figure out why Safari (3.0.4) won't send If-Modified-Since headers for SWFs in some cases.  I have observed that for some SWFs, Safari never sends the If-Modified-Since header, while it does for other content such as graphics and other SWFs.  Also, IE and Firefox/Mozilla seem to handle these particular SWFs just fine.  I did find mention of this issue from several years ago at http://www.codepoetry.net/archives/2003/11/07/safari_and_ifmodifiedsince.php
.  Are these SWFs not making into the Safari cache at all (this has been really hard to verify which is why I'm not sure), or is there some other reason that Safari does not send the If-Modified-Since header (maybe the HTTP headers applied by the server or something).  I am looking for any information that will help in working around this issue, or some idea of when it might be fixed.
Comment 1 Alexey Proskuryakov 2008-03-18 01:25:48 PDT
I suspect that this may be caused by a broken (empty) Cache-Control header in the server response:

HTTP/1.1 200 OK
Date: Tue, 18 Mar 2008 08:07:54 GMT
Server: Apache/2.2.3 (Linux/SUSE)
Last-Modified: Thu, 04 Oct 2007 22:27:30 GMT
ETag: "18414b-51031-43bb24aae5880"
Accept-Ranges: bytes
Cache-Control: 
Expires: Tue, 18 Mar 2008 08:07:54 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Pragma: 
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/x-shockwave-flash

Some experimentation would be needed to determine if this is indeed the cause.

> Also, IE and Firefox/Mozilla seem to handle these particular SWFs just fine.

Even though the response is malformed, this difference in behavior can be seen as a bug in system frameworks below WebKit, and thus needs to be filed at <http://bugreport.apple.com> for Apple engineers working on those to take a look.
Comment 2 Ryan Warnick 2008-03-26 22:59:55 PDT
Here are the response headers that are being sent with one of the SWFs that have the problem:

HTTP/1.1 200 OK
Date: Thu, 27 Mar 2008 05:42:33 GMT
Server: Apache/2.2.4 (Win32) mod_scgi/1.12 PHP/5.2.2
Last-Modified: Mon, 24 Mar 2008 02:45:14 GMT
ETag: "aaa55-168ce8-d3456280"
Accept-Ranges: bytes
Cache-Control: 
Expires: Thu, 27 Mar 2008 05:42:33 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Pragma: 
Keep-Alive: timeout=5, max=80
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/x-shockwave-flash

The Cache-Control header is empty.  I will try setting this to something and see if it helps.  The odd thing is that Safari is caching some SWFs correctly using these same response headers.  If the problem is the empty Cache-Control, it seems like it would be consistently not caching everything and not sending the If-Modified-Since headers in every case.
Comment 3 Ryan Warnick 2008-03-26 23:29:40 PDT
I just changed the Cache-Control header to "must-revalidate" and I am still seeing the same issue.  Maybe it has something to do with the file size.  In any case, I am still seeing the same strange behavior where some resources like HTML, JS, image files, and other SWFs seem to cache correctly and send the If-Modified Since header, but another set of SWFs (mostly larger ones) never send the If-Modified-Since header.
Comment 4 Alexey Proskuryakov 2008-05-12 10:19:24 PDT
The test file is over 300K in size, too large to be cached because of a bug - see bug 18972 for more details.

*** This bug has been marked as a duplicate of 18972 ***