The portion appended to .htaccess:

Header add Expires "Sun, 19 Nov 1978 05:00:00 GMT"

causes IE6/7 to fail when accessing URL's that contain direct links to files. For instance, a link to a .doc included in an email fails in IE, but works fine in Firefox, Safari, etc. Commenting out the add or the mod_headers directive altogether allows IE downloads to function, but may cause other Boost issues, as mentioned in #339571: Dependency on mod_headers.

By wrapping the

<IfModule mod_headers.c>

portion of .htaccess with a <FilesMatch> directive that filters against file extensions intended for download, we can get IE to function properly. I would think this causes inconvenience to other sites that serve downloads as public and want to use Boost.

Perhaps an agent check in .htaccess combined with FilesMatch would be a proper solution, provided continued dependency on mod_headers.

Comments

Alexander Ufimtsev’s picture

in my tests the problem was actually caused by the Cache-Control part of the statement. Internet Explorer 6 (IE6), but not IE7 or IE8 would just hang indefinitely while trying to open up a page (not referring document). The following workaround helped:

  • using BrowserMatch to see whether client uses IE6
  • activating Cache-Control only if he or she does not.

So the beginning of Boost code in .htaccess would look like this:

 # BOOST START
  <IfModule mod_setenvif.c>
    BrowserMatch "MSIE 6\.0" ie6
  </IfModule>

  <IfModule mod_headers.c>
    Header add Expires "Sun, 19 Nov 1978 05:00:00 GMT"
    Header add Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0" env=!ie6
  </IfModule>

Of course, this is not a complete fix because it could cache pages locally and require manual refresh in order to see the updated versions, but still MUCH better than not being able to load them at all.

mikeytown2’s picture

Alexander Ufimtsev’s picture

Thanks for the link, Mikey!

The problem was created by 'Header add' directive. This way, Apache sent two expires dates and two cache-control directives, and poor IE6 got confused. 'Header set' should have been used instead.

Here is updated .htaccess code for Boost (with some sanity checks not to add expires header to everything):

  # BOOST START
  <FilesMatch "\.(html.gz|html)$">
    <IfModule mod_headers.c>
      Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
      Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
    </IfModule>
    <IfModule mod_mime.c>
      AddCharset utf-8 .html
    </IfModule>
  </FilesMatch>
... (rewrite conditions here)...
mikeytown2’s picture

Here's the manual for mod_headers
http://httpd.apache.org/docs/trunk/mod/mod_headers.html#header

Depending on how it all works out, set or append or merge should be used; add was the wrong way to do it.

mikeytown2’s picture

Status: Active » Closed (fixed)

Closing all 5.x issues; will only reevaluate if someone steps up #454652: Looking for a co-maintainer - 5.x

Reason is 6.x has 10x as many users as 5.x; also last 5.x dev was over a year ago. The 5.x issue queue needs to go.